Is there a way to hide some categories in the dashboard for some users/roles so they won't appear? It should affect both the dropdown menu in the post list and the category checkbox selector in the post page:

screenshot #1 and

screenshot #2

  • It would be rather messy. You could add a custom capability and filter the list but what if your user adds a category that clashes with a hidden one? Maybe a custom taxonomy with this restriction would suit your needs better. Aug 3, 2016 at 18:37
  • The role for these users prevents them to adding categories. Tell me more how would you do this. BTW I am already filtering visible posts by category in the dashboard, however the category list is complete and would like to hide unwanted items
    – Riccardo
    Aug 3, 2016 at 18:39
  • Tell us what you have tried so far for yourself. You might find it helpful to review How to Ask Aug 3, 2016 at 18:47
  • Well at the moment I have filtered posts in functions.php so for some roles they won't be visible. Category based. I have made no attempt to hide selected categories in dashboard but I am aware of testing user roles...
    – Riccardo
    Aug 3, 2016 at 18:50

1 Answer 1


You could hook to the get_terms_args filter conditionally depending on your user/role

Something along those lines

add_filter( 'get_terms_args', 'restrict_cat', 10, 2 );
function restrict_cat( $args, $taxonomies ){

  // Don't run if we are not dealing with categories
  if( 'category' != $taxonomies[0] )
    return $args;

  // The check for the user we want to restrict
  // you could use current_user_can( $capability ) or test for a specific role here
  if( 1 == get_current_user_id() ){
    $args['exclude'] = array( 

    return $args;

  return $args;

check out https://developer.wordpress.org/reference/functions/get_terms/ for a list of available args.

  • Edited the code, after some testing, I found that my first answer was throwing some errors and disabling all categories for that specific user. This should now work
    – bynicolas
    Aug 3, 2016 at 19:38
  • I'm glad I could help! cheers :)
    – bynicolas
    Aug 3, 2016 at 20:57

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.