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

Is there a way to use regular categories with custom post types? It seems like there is better functionality and options with regular categories (such as permalink options, etc.).

share|improve this question
up vote 5 down vote accepted

No problem, the categories and tags are also registered as taxonomies that you can pass to the taxonomies argument when you call register_post_type(). Categories are category and tags are post_tag. You can also do this later with register_taxonomy_for_object_type():

add_action( 'init', 'wpse6098_init', 100 ); // 100 so the post type has been registered
function wpse6098_init()
    register_taxonomy_for_object_type( 'category', 'your_custom_post_type' );
share|improve this answer
Sweet!! Works perfectly. Thanks a bunch! – David Dec 29 '10 at 21:20
Is there an easy way to get the custom post type posts to show up in filtering results, too? – Rasmus Sep 5 '12 at 22:19
@Rasmus: Do you mean on the category pages? Like /category/banana/, do you want to see regular posts and your custom post types mixed together? I think you need to hook into the query parameters and add your custom post type to the post_type parameter. But it has been a while since I used WordPress, it's not in my active memory now :-) – Jan Fabry Sep 6 '12 at 7:12
Yep, that's exactly what I wanted. My reason is that otherwise it might be a little hard finding those posts. If someone has the answer in active memory, it would be appreciated -- until then, I'll make do with my (not pretty) work-around! – Rasmus Sep 7 '12 at 8:07

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.