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

Standard WordPress post types have "Post Tags" which can be used to "tag" posts with similar content, makes those similar posts easily accessible just by opening that particular tag page and receiving the list of all posts.

I need exactly the same thing with my custom post types:

  • ability to tag the post with multiple tags
  • ability to list all custom posts tagged with the same tag by opening that tag page

How do I add support for adding tags to my custom post types?

share|improve this question
up vote 3 down vote accepted

I actually managed to figure it out and did it just beside the code of my custom post type. Like Fred suggested, I need to add a taxonomy to my custom post type called "tag".

And this is the way to do it:

        'hierarchical' => false,
        'labels' => array
            'name' => _x( 'My Post Type Tags', 'taxonomy general name' ),
            'singular_name' => _x( 'My Post Type Tag', 'taxonomy singular name' ),
            'search_items' =>  __( 'Search My Post Type Tags' ),
            'all_items' => __( 'All My Post Type Tags' ),
            'edit_item' => __( 'Edit My Post Type Tag' ), 
            'update_item' => __( 'Update My Post Type Tag' ),
            'add_new_item' => __( 'Add New My Post Type Tag' ),
            'new_item_name' => __( 'New My Post Type Tag Name' ),
            'menu_name' => __( 'My Post Type Tags' ),
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => array('slug' => 'myposttype-tag', 'with_front' => true),
share|improve this answer

Easy. Funny enough I was tackling that very same issue myself.

Get yourself the "Custom Post Type UI" plugin. Create a custom taxonomy for your custom post type, called "tag".

Whenever the user creates a new custom post, she will always be able to add a tag.

This tag should then be available in the form of a permalink and deliver all the custom post that are labeled under it.

share|improve this answer
This answer is quite useful, but I require a solution I can write as PHP code. – Miljenko Barbir Oct 3 '11 at 18:51

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.