Plugin to restrict non-admin user to existing tags

If you do not already have your tags created, you can use the “Bulk Add Tags” plugin – http://wordpress.org/extend/plugins/bulk-add-tags/

Then to restrict all users except admins from adding new tags via the “New Post” screen, add this code to your theme’s functions.php file:

//Hide Post Page Options from all except Administrator
if (!current_user_can('administrator')){
function hide_post_page_options() {
global $post;
$hide_post_options = "<style type=\"text/css\"> .jaxtag { display: none; }</style>";
print($hide_post_options);
}
add_action( 'admin_head', 'hide_post_page_options'  );
}

This will simply hide the box for entering new tags from all users except administrators.

I actually use this method to hide many areas of the “New Post” page. Simply find and add the element’s div class or id before { display: none; } and separated by commas. If you’re unfamiliar, you can use the Firebug plugin with Firefox, or simply right-click and select “Inspect Element” in Chrome.

I prefer this method over many plugins because it does not remove functionality completely from WordPress, the functionality is simply hidden from users who do not need it.

Leave a Comment