Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:06:59+00:00 2026-06-11T16:06:59+00:00

I run a multiple author website. I want to restrict a few tags from

  • 0

I run a multiple author website. I want to restrict a few tags from being selected by my authors.

The only options that I found so far was techniques to replace the free tag text field with a list (similar to the category list). This is not a solution for me as I will need my authors to be able to create new tags.

Surely there must be a way to restrict specific tags from non-admins? Do you know how? Any brainstorming or proper solutions are welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:07:00+00:00Added an answer on June 11, 2026 at 4:07 pm

    I think the ideal solution would be to conditionally filter the taxonomy query used in post_tags_meta_box as it ajaxes its suggestions, and maybe even providing some error-handling if someone tried to manually type the tag you don’t want them to use, but I’m not aware of a filter that could aid in pulling that off.

    Expanding on Giordano’s suggestion and referencing this other question, you could use something like this in functions.php

    add_action('save_post', 'remove_tags_function', 10, 1); //whenever a post is saved, run the below function
    
    function remove_tags_function( $post_id ){
        if(!current_user_can('manage_options')){ // if the logged in user cannot manage options (only admin can)
            $post_tags = wp_get_post_terms( $post_id, 'post_tag', array( 'fields'=>'names' ) ); //grab all assigned post tags
            $pos = array_search( 'tag-to-be-deleted', $post_tags ); //check for the prohibited tag
            if( false !== $pos ) { //if found
                unset( $post_tags[$pos] ); //unset the tag
                wp_set_post_terms ($post_id, $post_tags, 'post_tag'); //override the posts tags with all prior tags, excluding the tag we just unset
            }
        }//end if. If the current user CAN manage options, the above lines will be skipped, and the tag will remain
    }
    

    Non-admin users will still be able to type in and add tag-to-be-deleted, but it will not stick to the post. Once saved, the tag will be stripped. If the user is really dedicated, they could spell it differently, or, as you saw, change the capitalization, but whatever they do it wont technically be the same tag, and you will be able to keep it pure for whatever theme purpose you need. I can’t imagine a situation in which a user without admin capabilities could add the forbidden tag, but I know better than to never say never.

    If you want to allow certain non-admin users to assign the forbidden tag to a post, you’ll have to revise the parameter passed into line 4 if(!current_user_can('...'){. For information on other capabilities you can pass to this conditional statement, check the WordPress documentation of Roles & Capabilities. It’s much easier to check for a capability than a role, so pick a logical capability that is restricted to the levels of user that you wish to be exempt from the tag deletion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a method that run multiple threads and I want before
I want to run multiple instances of apache on one single machine? How to
I would like to run multiple websites, and I would like each website (differentiated
What can i use to make multiple tabs that run multiple forms in my
I've been trying to find something that will let me run multiple commands on
I want to run multiple Python versions in my box. Is there any version
I want to run multiple versions of MATLAB (with standalone licenses) on a Windows
I want to run multiple instances of the following script parallel: for($i = 0;
I am trying to run multiple queries on some mysql dbs from a php
I've seen from Change the author and committer name and e-mail of multiple commits

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.