In the WP-Admin when creating a post or a custom post type I want to restrict certain categories to a custom post type. For example, Posts will only be able to select Category A and B. And custom post type A will only be able to select Category C and D.

Would I have to write some code to hook into somewhere or is there a function built-in to the framework?

Thanks in advance.

2 Answers 2


I think the best way to do this is to make a category (or taxonomy ) for a specific post type...

please see this link... http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/

  • Thank you. This is exactly what I looking for, I missed it the first time because it looked like tags and I did not specify hierarchical.
    – Evan Yeung
    Jun 22, 2011 at 15:33

I found my solution to this doing so:

add_action( 'init', 'build_taxonomies', 0 );  
function build_taxonomies() {  
    'news',  // this is the custom post type(s) I want to use this taxonomy for
        'hierarchical' => false,  
        'label' => 'News Types',  
        'query_var' => true,  
        'rewrite' => true  

Added to my functions.php Also, view the link above for the tutorial, that's where the other information comes from. Not great with PHP, but I'm sure you can also specify multiple post_types, instead of just 'news' in this example.

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.