5

As a site admin, I'd like to have control over things.

I'd like to prevent my contributors and authors ( who generate content for me ) from creating new tags. I don't want that tag taxonomy to turn into a zoo! Especially when you know that wordpress creates separate terms for apple and Apple! I give them a while list ( of 1000 tags that I want them to cover ) and that's it. They cannot come up with the 1001st.

How do I achieve that so that my authors just pick from what I give them?

3 Answers 3

1

This Wordpress Answers thread has exactly the information you are looking for - Plugin to restrict non-admin user to existing tags

Simply change "administrator" to whatever you need.

2

This is the most solid answer to this, if anyone ever comes to this post again.

This this in your functions.php file.

add_action( 'pre_insert_term', function ( $term, $taxonomy )
{
    return ( 'yourtax' === $taxonomy )
        ? new WP_Error( 'term_addition_blocked', __( 'You are unauthorized to add new terms.' ) )
        : $term;
}, 0, 2 );

I hope this helps anyone in the future.

1
  • 1
    The question mentioned specific roles that should be restricted, you should take them into account here, otherwise nobody will be able to create terms, Dec 7, 2017 at 1:41
0

Check this answer to your solution. I used remove_meta_box() WordPress internal function to solve similiar problem.

3
  • Please explain how to use remove_meta_box()
    – shea
    Dec 27, 2012 at 19:57
  • Also, simply removing the meta box will not allow users to add preexisting tags to the post
    – shea
    Dec 27, 2012 at 19:58
  • thank you guys. that would solve my problem. does anybody know how to remove a category from the non-admin and non-editors view? I'm trying to remove the 'FEATURED' category item under the available list of category items to not to show for the contributors and editors so that they cannot feature posts. Dec 28, 2012 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.