WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can i programatically change the Category selection menu on wp-admin? is there a hook or filter to edit the Category List?

My objective is to filter out specific categories for specific post-types, for example:

I have the categories: Sports,Players and Coaches

under the post-types: People and Activities

I want to filter the Sports Category out of the People Post-type.

share|improve this question

I went down the rabbit hole with this a few weeks ago. Never quite got it working right.

These might lead you in the right direction:



share|improve this answer
up vote 0 down vote accepted

i found the get_terms filter, that seemed to work fine for me:

  function filterCats($listCats){
    global $typenow;    
        foreach ($listCats as $k => $oCat) {
            if( $oCat->term_id == 6){//Sports Category id
     return $listCats;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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