WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Create Custom Taxonomies in WordPress

How to Create Custom Taxonomies in WordPress

Last updated on October 12th, 2020 by Editorial Staff
286 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Create Custom Taxonomies in WordPress

Do you want to create custom taxonomies in WordPress?

By default, WordPress allows you to organize your content with categories and tags. But with custom taxonomies, you can further customize the way you sort your content.

In this article, we’ll show you how to easily create custom taxonomies in WordPress with or without using a plugin.

How to create custom taxonomies in WordPress

While creating custom taxonomies is powerful, there’s a lot to cover. To help you set this up properly, we have created an easy table of content below:

  • What is a WordPress Taxonomy?
  • How to Create Custom Taxonomies in WordPress
  • Creating Custom Taxonomies With A Plugin (The Easy Way)
  • Creating Custom Taxonomies Manually (with code)
  • Displaying Custom Taxonomies
  • Adding Taxonomies For Custom Posts
  • Adding Custom Taxonomies to Navigation Menu
  • Take WordPress Taxonomies Further

What is a WordPress Taxonomy?

A WordPress taxonomy is a way to organize groups of posts and custom post types. The word taxonomy comes from the biological classification method called Linnaean taxonomy.

By default, WordPress comes with two taxonomies called categories and tags. You can use them to organize your blog posts.

However, if you are using a custom post type, then categories and tags may not look suitable for all content types.

For instance, you can create a custom post type called ‘Books’ and sort it using a custom taxonomy called ‘topics’.

You can add topic terms like Adventure, Romance, Horror, and other book topics you want. This would allow you, and your readers to easily sort books by each topic.

Taxonomies can also be hierarchical, meaning that you can have main topics like Fiction and Nonfiction. Then you’d have subtopics under each category.

For example, Fiction would have Adventure, Romance, and Horror as sub-topics.

Now that you know what a custom taxonomy is, let’s learn how to create custom taxonomies in WordPress.

How to Create Custom Taxonomies in WordPress

We will use two methods to create custom taxonomies. First, we’ll use a plugin to create custom taxonomies.

For the second method, we’ll show you the code method, and how to use it to create your custom taxonomies without using a plugin.

Create Custom Taxonomies In WordPress (Video Tutorial)

Subscribe to WPBeginner

If you prefer written instructions, then continue reading.

Creating Custom Taxonomies With A Plugin (The Easy Way)

First thing you need to do is install and activate the Custom Post Type UI plugin. For details, see our guide on how to install a WordPress plugin.

In this tutorial, we’ve already created a custom post type and called it ‘Books.’ So make sure you have a custom post type created before you begin creating your taxonomies.

Next, go to CPT UI » Add/Edit Taxonomies menu item in the WordPress admin area to create your first taxonomy.

Creatig custom taxonomy using plugin

On this screen, you will need to do the following:

  • Create your taxonomy slug (this will go in your URL)
  • Create the plural label
  • Create the singular label
  • Auto-populate labels

Your first step is to create a slug for the taxonomy. This slug is used in the URL and in WordPress search queries.

This can only contain letters and numbers, and it will automatically be converted to lowercase letters.

Next, you will fill in the plural and singular names for your custom taxonomy.

From there, you have the option to click on the link ‘Populate additional labels based on chosen labels’. If you do this, then the plugin will auto-fill in the rest of the label fields for you.

Now, scroll down to the ‘Additional Labels’ section. In this area, you can provide a description of your post type.

Labeling your WordPress taxonomy

These labels are used in your WordPress dashboard when you’re editing and managing content for that particular custom taxonomy.

Next up, we have the settings option. In this area, you can set up different attributes for each taxonomy you create. Each option has a description detailing what it does.

Create custom taxonomy hierarchy

In the screenshot above, you’ll see we chose to make this taxonomy hierarchical. This means our taxonomy ‘Subjects’ can have sub-topics. For instance, a subject called Fiction can have sub-topics like Fantasy, Thriller, Mystery, and more.

There are many other settings further down your screen in your WordPress dashboard, but you can leave them as-is for this tutorial.

You can now click on the ‘Add Taxonomy’ button at the bottom to save your custom taxonomy.

After that, go ahead and edit the post type associated with this taxonomy in the WordPress content editor to start using it.

Using taxonomy in post editor

Creating Custom Taxonomies Manually (with code)

This method requires you to add code to your WordPress website. If you have not done it before, then we recommend reading our guide on how to easily add code snippets in WordPress.

1. Creating a Hierarchical Taxonomy

Let’s start with a hierarchical taxonomy that works like categories and can have parent and child terms.

Add the following code in your theme’s functions.php file or in a site-specific plugin (recommended) to create a hierarchical custom taxonomy like categories:

//hook into the init action and call create_book_taxonomies when it fires

add_action( 'init', 'create_subjects_hierarchical_taxonomy', 0 );

//create a custom taxonomy name it subjects for your posts

function create_subjects_hierarchical_taxonomy() {

// Add new taxonomy, make it hierarchical like categories
//first do the translations part for GUI

  $labels = array(
    'name' => _x( 'Subjects', 'taxonomy general name' ),
    'singular_name' => _x( 'Subject', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search Subjects' ),
    'all_items' => __( 'All Subjects' ),
    'parent_item' => __( 'Parent Subject' ),
    'parent_item_colon' => __( 'Parent Subject:' ),
    'edit_item' => __( 'Edit Subject' ), 
    'update_item' => __( 'Update Subject' ),
    'add_new_item' => __( 'Add New Subject' ),
    'new_item_name' => __( 'New Subject Name' ),
    'menu_name' => __( 'Subjects' ),
  ); 	

// Now register the taxonomy
  register_taxonomy('subjects',array('books'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'show_in_rest' => true,
    'show_admin_column' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'subject' ),
  ));

}

Don’t forget to replace the taxonomy name and labels with your own taxonomy labels. You will also notice that this taxonomy is associated with the Books post type, you’ll need to change that to whatever post type you want to use it with.

2. Creating a Non-hierarchical Taxonomy

To create a non-hierarchical custom taxonomy like Tags, add this code in your theme’s functions.php or in a site-specific plugin:

//hook into the init action and call create_topics_nonhierarchical_taxonomy when it fires

add_action( 'init', 'create_topics_nonhierarchical_taxonomy', 0 );

function create_topics_nonhierarchical_taxonomy() {

// Labels part for the GUI

  $labels = array(
    'name' => _x( 'Topics', 'taxonomy general name' ),
    'singular_name' => _x( 'Topic', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search Topics' ),
    'popular_items' => __( 'Popular Topics' ),
    'all_items' => __( 'All Topics' ),
    'parent_item' => null,
    'parent_item_colon' => null,
    'edit_item' => __( 'Edit Topic' ), 
    'update_item' => __( 'Update Topic' ),
    'add_new_item' => __( 'Add New Topic' ),
    'new_item_name' => __( 'New Topic Name' ),
    'separate_items_with_commas' => __( 'Separate topics with commas' ),
    'add_or_remove_items' => __( 'Add or remove topics' ),
    'choose_from_most_used' => __( 'Choose from the most used topics' ),
    'menu_name' => __( 'Topics' ),
  ); 

// Now register the non-hierarchical taxonomy like tag

  register_taxonomy('topics','books',array(
    'hierarchical' => false,
    'labels' => $labels,
    'show_ui' => true,
    'show_in_rest' => true,
    'show_admin_column' => true,
    'update_count_callback' => '_update_post_term_count',
    'query_var' => true,
    'rewrite' => array( 'slug' => 'topic' ),
  ));
}

Notice the difference between the 2 codes. Value for hierarchical argument is true for category-like taxonomy and false for tags-like taxonomies.

Also, in the labels array for non-hierarchical tags-like taxonomy, we have added null for parent_item and parent_item_colon arguments which means that nothing will be shown in the UI to create parent item.

Taxonomies in post editor

Displaying Custom Taxonomies

Now that we have created custom taxonomies and have added a few terms, your WordPress theme will still not display them.

In order to display them, you’ll need to add some code to your WordPress theme or child theme.

This code will need to be added in templates files where you want to display the terms.

Usually, it is single.php, content.php, or one of the files inside the template-parts folder in your WordPress theme. To figure out which file you need to edit, see our guide to WordPress template hierarchy for details.

You will need to add the following code where you want to display the terms.

<?php the_terms( $post->ID, 'topics', 'Topics: ', ', ', ' ' ); ?>

You can add it in other files as well such as archive.php, index.php, and anywhere else you want to display the taxonomy.

Custom Taxonomy Displayed

By default your custom taxonomies use the archive.php template to display posts. However, you can create a custom archive display for them by creating taxonomy-{taxonomy-slug}.php.

Adding Taxonomies For Custom Posts

Now that you know how to create custom taxonomies, let’s put them to use with an example.

We’re going to create a taxonomy and call it Non-fiction.

Since we have a custom post type named ‘Books,’ it’s similar to how you’d create a regular blog post.

In your WordPress dashboard, go to Books » Subjects to add a term or subject.

Adding a term for your newly created custom taxonomy

On this screen, you’ll see 4 areas:

  • Name
  • Slug
  • Parent
  • Description

In the name, you’ll write out the term you want to add. You can skip the slug part and provide a description for this particular term (optional).

Lastly, click the ‘Add New Subject’ button to create your new taxonomy.

Your newly added term will now appear in the right column.

Term added

Now you have a new term that you can use in your blog posts.

You can also add terms directly while editing or writing content under that particular post type.

Simply go to the Books » Add new page to create a post. On the post edit screen, you’ll find the option to select or create new terms from the right column.

Adding new terms or select from existing terms

After adding terms, you can go ahead and publish that content.

All your posts filed under that term will be accessible on your website on their own URL. For instance, posts filed under Fiction subject would appear at the following URL:

https://example.com/subject/fiction/

Taxonomy template preview

Adding Custom Taxonomies to Navigation Menu

Now that you have created custom taxonomies, you may want to display in your website’s navigation menu.

Go to Appearance » Menus and select the terms you want to add under your custom taxonomy tab.

Adding terms to navigation menu

Don’t forget to click on the Save Menu button to save your settings.

You can now visit your website to see your menu in action.

Adding custom taxonomy in navigation menu

For more detailed, see our step by step guide on how to create a dropdown menu in WordPress.

Take WordPress Taxonomies Further

There are a ton of things you can do with custom taxonomies. For instance, you can show them in a sidebar widget or add image icons for each term.

You can also add enable RSS feed for custom taxonomies in WordPress and allow users to subscribe individual terms.

If you want to customize the layout of your custom taxonomy pages, then you can check out Beaver Themer or Divi. They’re both drag and drop WordPress page builder that allows you to create custom layouts without any coding.

We hope this article helped you learn how to create custom taxonomies in WordPress. You may also want to see our guide on how WordPress works behind the scenes, and how to create a custom WordPress theme without writing any code.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

286 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

102 Comments

Leave a Reply
  1. Gina Wilson says:
    Nov 18, 2020 at 7:32 pm

    This tutorial and specifically the part of how to display the custom taxonomy was a lifesaver! I’m very much a beginner and this was very helpful in understanding where I went wrong in my coding.

    Thank you!!!

    Reply
    • WPBeginner Support says:
      Nov 19, 2020 at 10:06 am

      Glad our guide was helpful :)

      Reply
  2. fengquanli says:
    Oct 15, 2020 at 7:58 am

    this is very confident with the custom post ui, thanks very much ,it’s very useful for get them.

    Reply
    • WPBeginner Support says:
      Oct 15, 2020 at 9:54 am

      Glad our guide was helpful :)

      Reply
  3. Bruno Oliveira says:
    Oct 14, 2020 at 10:52 am

    Awesome tutorial! i have one question. how do i use my new taxonomy slug as permalink like category (/%category%/%year%/%monthnum%/%day%/%postname%/)

    I want something like /%custom_taxonomy%/%year%/%monthnum%/%day%/%postname%/

    i keep getting 404 error

    Reply
    • WPBeginner Support says:
      Oct 15, 2020 at 10:42 am

      That is not something WordPress would allow by default and would require some custom coding to set up.

      Reply
  4. vikas says:
    Sep 29, 2020 at 2:54 am

    i tried the plugin method , it sucessfully created a new category in custom post type but it is not showing on my posts like tags and other categoties. can you help me with that?

    Reply
    • WPBeginner Support says:
      Sep 29, 2020 at 9:30 am

      You would want to reach out to the support for your specific theme for customizing the display to include your taxonomy.

      Reply
  5. Richard says:
    Sep 28, 2020 at 4:39 am

    I am creating a podcast network where I have multiple podcasts on a single site with episodes under each individual podcast. Would something like this work for that? I really don’t want to go the multi site route.

    Reply
    • WPBeginner Support says:
      Sep 28, 2020 at 11:20 am

      You can certainly use this should you want or another option would be to create a custom post type depending on your preference.

      Reply
  6. Maria says:
    Sep 21, 2020 at 10:37 am

    Hello is possible add the custom taxonomies to a custom product type?

    I create a custom product call drinks and i have several taxonomies like country, material and etc

    I want when the user click in drinks then only apperas those taxonomies, is this posiible?

    Reply
    • WPBeginner Support says:
      Sep 22, 2020 at 9:56 am

      You should be able to using the plugin method.

      Reply
  7. Parveen Kaushik says:
    Jun 4, 2020 at 1:04 pm

    Hi,
    Thanks for this article, I am getting 404 page after using this code, can you help me

    Reply
    • WPBeginner Support says:
      Jun 5, 2020 at 8:40 am

      If you haven’t done so yet, resave your permalinks for the most common solution :)

      Reply
  8. Mike Smith says:
    Jun 1, 2020 at 5:31 pm

    this code works great on my site for work. Can you tell me how to add the custom taxonomy into the site’s rss feed?

    Reply
    • WPBeginner Support says:
      Jun 2, 2020 at 9:05 am

      It would depend on what you are looking for, for a starting point you would want to take a look at our article below:
      https://www.wpbeginner.com/wp-tutorials/how-to-make-a-separate-rss-feed-for-each-custom-post-type-in-wordpress/

      Reply
  9. angela says:
    Mar 8, 2020 at 4:15 am

    thank you for taking the time to post this, this was the first site that actually explained this and it made sense, haha. im a happy camper now

    Reply
    • WPBeginner Support says:
      Mar 9, 2020 at 11:51 am

      You’re welcome, glad our guide could help simplify the process :)

      Reply
  10. Jem says:
    Aug 21, 2019 at 8:18 am

    How to show custom taxonomy (checkbox list) in Post editor page like category and tag?

    Reply
    • WPBeginner Support says:
      Aug 21, 2019 at 9:10 am

      It would depend on which method you used to create the custom taxonomy, if you’re using the plugin you would want to reach out to the plugin’s support to make sure they have show_in_rest set to true for seeing it in the block editor.

      Reply
      • Jem says:
        Aug 21, 2019 at 9:42 am

        No, I am not using any plugin. I have just copy paste your snippet. Its create new taxonomy. But it is not display in post editor page like category, tags display on rightside panel.

        Can you please guide me how can I show custom taxonomy in post editor page?

        Reply
        • WPBeginner Support says:
          Aug 22, 2019 at 9:13 am

          In the register_taxonomy array, you would want to first try adding a new line with the code below:
          ‘show_in_rest’ => true,

  11. Jim Gersetich says:
    Apr 3, 2019 at 4:23 pm

    The first half of this post is completely useless. the Simple Taxonomy plugin doesn’t work with the current WordPress version, and it hasn’t been updated in four years.

    Please try to find another plugin and change that section to go with the new one.

    Reply
    • WPBeginner Support says:
      Apr 4, 2019 at 11:10 am

      Thank you for letting us know, we’ll certainly take a look at updating this article.

      Reply
  12. joe barrett says:
    Mar 28, 2019 at 1:01 pm

    Don’t forget to add ‘show_in_rest’ => true,
    if you want to use your custom items in rest api to $args

    Reply
    • WPBeginner Support says:
      Mar 29, 2019 at 10:16 am

      Thanks for sharing this for those wanting to add this functionality.

      Reply
  13. Michael Morad-McCoy says:
    Mar 2, 2019 at 11:57 am

    I tried putting this in a site-specfic plug-in and get the following in a box at the top:
    y() expects parameter 1 to be a valid callback, function ‘create_topics_hierarchical_taxonomy’ not found or invalid function name in /home2/kaibabpr/public_html/wp-includes/class-wp-hook.php on line 286

    Warning: Cannot modify header information – headers already sent by (output started at /home2/kaibabpr/public_html/wp-includes/class-wp-hook.php:286) in /home2/kaibabpr/public_html/wp-admin/includes/misc.php on line 1198

    as this is the first time I tried this, I’m at a loss.

    Reply
    • WPBeginner Support says:
      Mar 4, 2019 at 12:59 pm

      You may want to ensure your site-specific plugin is a php file after you added the code as sometimes your operating system can try to edit the file type.

      Reply
  14. Naji Boutros says:
    Nov 10, 2018 at 1:29 pm

    Do you have a different plugin to recommend?

    Reply
  15. Ajeet singh says:
    Oct 17, 2018 at 3:16 am

    this is very helpful tutorial …..thnks a lot.

    Reply
  16. Suresh says:
    Oct 6, 2018 at 2:51 pm

    Thanks for sharing this code. I used non-hierarchy code, and admin part is working fine. I have created a separate template as well like taxonomy-[taxoName]-.php But while trying to access the URL, giving HTTP error 500. I have tried multiple things, like new cache starts, permalink re-save, new .htaccess and memory increase. even then page is not working. kindly help

    Reply
  17. Rabby says:
    Jun 10, 2018 at 5:21 am

    WOW, Amazing and helpful details. I’ve created my custom taxonomy using manual rules. Thanks

    Reply
  18. Joseph Peter says:
    Feb 8, 2018 at 12:48 pm

    Hi,
    than you for this useful information, iam new to wordpress and i wanted to know the meaning thats i landed here, it was actually helpful.

    Best Regards

    Joseph Peter

    Reply
  19. Cindi Gay says:
    Jun 8, 2017 at 9:37 am

    I used the code for adding a tag to a custom post type. Luckily Topics is exactly the label I needed so all I needed to change was post to lesson (I am modifying the LifterLMS lesson post type).

    Now I want to display the tags. I tried using the default WordPress Tag Cloud but it does not change to the newly added tag. It continues to show all my post tags even when I choose Topics

    Is there a step I am missing? How do I display the new tag: Topics?

    Reply
  20. Ero says:
    May 31, 2017 at 3:23 am

    Taxonomies don’t behave exactly like default posts’ categories. They don’t appear in the URL (especially for nested taxonomies). Is there any way to set a custom taxonomy associated to a custom post type to behave like posts’ categories ?

    Reply
  21. Rangan Roy says:
    Feb 19, 2017 at 12:54 am

    I have used this code in my gallery custom post type for category support. It shows the name of the category but when i click on the category name it shows 404:error not found. Please help me to solve it. I want the category posts to show on my archive.php page.

    Reply
    • Utshab Roy says:
      Aug 27, 2018 at 8:17 am

      I got this same problem that you are facing. The way I solved it is very easy. Go to your permalink settings and click the save button. Refresh the page. This simple step will save the issue.

      Reply
      • Carol says:
        Oct 17, 2018 at 6:40 pm

        This worked! Thank you so much.

        Reply
  22. Russell says:
    Dec 22, 2016 at 11:44 am

    Hi, I created custom meta box with new category. I can also show it to the post page. But when I click to the newly created category item it gives a 404 page. I wan it to work like tags, default category or author. So that If I click it shows all the post under that category.

    Reply
  23. Olivier says:
    Oct 22, 2016 at 1:12 pm

    Hello,

    I am new to WordPress and coding in general. This tutorial is very well explained, thank you.

    However I don’t understand how to display the terms of my taxonomy on my pages.
    Where do I have to go to “Add this single line of code in your single.php file within the loop” ?

    Thank you for your help
    Best,
    Olivier

    Reply
  24. Azamat says:
    Sep 28, 2016 at 3:05 am

    Thank you so much for this great tutorial!
    I created custom taxanomy on my website dedicated to books and now I’m able to filter books by authors!

    Reply
  25. James Angel says:
    Sep 14, 2016 at 10:11 am

    The trouble with some plugins is that they may not be compatible with all themes. I have found that it pays to have a qualified developer do his/her part and test and troubleshoot any Web site alteration after adding a plugin or updating WordPress to a newer version to ensure everything works as it should.

    Reply
  26. paul says:
    Sep 5, 2016 at 7:01 am

    Man you are a legend,
    i struggled 3 days to get this, which i found in many websites, but not as clear as this.
    Thanks!

    Reply
    • WPBeginner Support says:
      Sep 5, 2016 at 11:12 am

      Hey Paul, glad you found it helpful. Don’t forget to follow us on Facebook for more WordPress tips and tutorials.

      Reply
      • Rangan Roy says:
        Feb 14, 2017 at 6:22 am

        I have used this code in my gallery custom post type for category support. It shows the name of the category but when i click on the category name it shows 404.php page. Please help me to solve it. I want the category posts to show on my archive.php page.

        Reply
  27. Ayla says:
    Aug 12, 2016 at 4:47 pm

    I’ve created a custom post type and a taxonomy to go with it, but when I create a custom post and add tags to it they don’t show up like normal tags do on normal posts. How do I get them to display at the bottom of the post like normal so people can click on them and find more like it?

    Thank you!
    -Ayla

    Reply
    • WPBeginner Support says:
      Aug 12, 2016 at 11:21 pm

      You will need to create a new template to display your custom post type and edit that template to show your custom taxonomy.

      Reply
  28. Giulia says:
    Jul 26, 2016 at 5:38 am

    Hi everybody! First of all thank you for this article!
    I’ve found that “Simple Taxonomies” plugin is kind of out of date, since it hasn’t been updated since 2 years…. do you have any other plugin to suggest to create custom taxonomies?
    thanks :-)
    Giulia

    Reply
    • Mario says:
      Aug 20, 2016 at 6:35 pm

      I’m not the author of this post, but I use “Custom Post Type UI” to create custom taxonomies. With 300k installs, I’m pretty sure this plugin is as close as you can get to industry standard.

      Hope this helps!

      Reply
  29. Ryan Hall says:
    Jun 9, 2016 at 5:32 pm

    Amazing. thank you!

    Reply
  30. Ryan says:
    Apr 12, 2016 at 3:22 pm

    How do you disassociate the posts with the “regular” categories?

    Reply
    • WPBeginner Support says:
      Apr 12, 2016 at 9:47 pm

      Please see our guide on how to merge and bulk edit categories and tags in WordPress.

      Reply
  31. Sunny says:
    Apr 5, 2016 at 11:21 pm

    Hello,

    The description is not prominent by default; however, some themes may show it. But still show on front.

    How to hide taxonomy description from front ?
    I want to add description on taxonomy but i don’t want they show on front .

    Please tell me about what i can do.

    Thank You

    Reply
  32. ajax says:
    Mar 4, 2016 at 10:07 pm

    How do one automate the population of the taxonomy value with the value in a custom field.

    Reply
  33. Charles Hall says:
    Jan 19, 2016 at 2:39 pm

    The article is OK, but the video is very poor. The sound quality is bad, she talks way too fast, obvious things are elaborated on but the explanation of what you’re doing and why is missing, as is the other content in the lower portion of the article.

    Reply
  34. Jennifer says:
    Jan 3, 2016 at 3:12 pm

    I am working on a WordPress website. I created categories using a plugin called “Categories Images”. One of the categories is named “Videos” so there is one folder/category that is supposed to show videos but images. The problem is, because the plugin is designed to upload images only, the YouTube videos do not show up. How can I edit the PHP files (create a custom taxonomy, edit single.php, edit taxonomy-{taxonomy-slug}.php, etc.) so that the post can show and play YouTube videos??

    Reply
    • Jamie Wallace says:
      Apr 18, 2016 at 5:04 pm

      If you want more control over how things are pulled from the backend to the frontend look into using the Advanced Custom Fields plugin. This is a plugin for developers (so some code is involved) but its very powerful for things like what you ask

      Reply
  35. Muhammad says:
    Oct 19, 2015 at 3:24 am

    Hi I have followed the manual way of creating custom taxonomy and i just used Ads/Ad instead of Topics/Topic . But i don’t see any custom taxonomy in post editor though i checked the custom taxonomy form Screen Options.

    though the custom taxonomy(Ads) is showing in admin submenu under Posts.

    Reply
    • Muhammad says:
      Oct 19, 2015 at 3:27 am

      Here is my code snipped in functions.php file

      _x( ‘Ads’, ‘taxonomy general name’ ),
      ‘singular_name’ => _x( ‘Ad’, ‘taxonomy singular name’ ),
      ‘search_items’ => __( ‘Search Ads’ ),
      ‘all_items’ => __( ‘All Ads’ ),
      ‘parent_item’ => __( ‘Parent Ad’ ),
      ‘parent_item_colon’ => __( ‘Parent Ad:’ ),
      ‘edit_item’ => __( ‘Edit Ad’ ),
      ‘update_item’ => __( ‘Update Ad’ ),
      ‘add_new_item’ => __( ‘Add New Ad’ ),
      ‘new_item_name’ => __( ‘New Ad Name’ ),
      ‘menu_name’ => __( ‘Ads’ ),
      );

      // Now register the taxonomy

      register_taxonomy(‘ads’,array(‘post’), array(
      ‘hierarchical’ => true,
      ‘labels’ => $labels,
      ‘show_ui’ => true,
      ‘show_admin_column’ => true,
      ‘query_var’ => true,
      ‘rewrite’ => array( ‘slug’ => ‘ad’ ),
      ));

      }

      ?>

      Reply
  36. Robert Herold says:
    Oct 15, 2015 at 6:02 pm

    How to show the number of posts on taxonomy-{taxonomy-slug}.php? :)

    Reply
  37. Robert Herold says:
    Oct 13, 2015 at 4:27 pm

    How can I display my custom taxonomies list like the category list

    Reply
    • WPBeginner Support says:
      Oct 13, 2015 at 5:11 pm

      Please see our guide How to display custom taxonomy terms in WordPress sidebar widgets.

      Reply
      • Robert Herold says:
        Oct 14, 2015 at 3:52 am

        Wow! Thanx! Superb!!!!!! :))

        Reply
  38. Abdul Rauf Bhatti says:
    Oct 4, 2015 at 4:25 pm

    Hy Dear WPBEGINNER SUPPORT,

    I have learned many things in this tutorial next time will you please elaborate functions parameter which you have used some time i got in trouble or confused with parameters.

    Thanks a lot Nice tutorial 5 rating

    Reply
    • WPBeginner Support says:
      Oct 5, 2015 at 3:38 pm

      Thanks for the feedback, we will try to improve our code explanation in the future.

      Reply
  39. lee says:
    Oct 2, 2015 at 5:55 pm

    Is there a way to get multiple custom taxonomy to use the same slug or same url? Please show us how if you or anyone knows.

    Reply
  40. pdepmcp says:
    Jul 27, 2015 at 5:57 pm

    It may sound obvious, but…remember to refresh the permalink cache or you can waste some hours trying to figure out why archive pages don’t work…

    Reply
    • Ilya says:
      Mar 26, 2018 at 4:31 pm

      Thank you very much!!!
      I wasted hours in debug mode, but cannot determine why my permalink redirects to 404 page! But after flushing “permalink cache” all works fine.
      Thank you again!

      Reply
  41. winson says:
    Mar 30, 2015 at 3:23 pm

    Hello.

    How can I get a different Posts Link? I mean I want to get 2 different links after I published a New Post.

    E.G:

    Category Name – > Facebook (theme template A)

    Topic Name – > Twitter (theme template B)

    Then I submit a post to these 2 Categories. I want get 1 link for “Facebook” and 1 Link for “Twitter”.

    Best Regards

    Reply
  42. foolish coder says:
    Mar 28, 2015 at 3:54 pm

    how to create single pages / templates for taxonomies?

    I mean like single.php not like category.php

    Reply
    • Alex says:
      Jun 24, 2015 at 9:01 am

      Try taxonomy.php ()

      Reply
  43. WPBeginner Staff says:
    Jan 22, 2015 at 12:03 am

    Yes, you can do that.

    Reply
  44. fatima says:
    Jan 21, 2015 at 1:05 pm

    what if we want to create more than 2 taxonomies, categories style (hierarchy true)

    Reply
  45. Aalaap Ghag says:
    Nov 19, 2014 at 4:08 pm

    I’m building a site which has multiple item thumbnails, each of which leads to a page with multiple images for that item (i.e. product). Are taxonomies the way to go or should I be looking at something else?

    Reply
  46. leona says:
    Oct 7, 2014 at 11:04 am

    Hi This is a great tutorial. But what if I want to display a custom taxonomies as posts in my menu? for instance I have a custom post type called ‘poems’ and custom taxomies classic, modern, new wave. each poem post is assigned one of these taxonomies. In the menu I want to see a menu entitled poems with 3 subheadings (classic, modrn, new wave). Each will display only the poems tagged with one taxonomy. Is this possible?

    Reply
  47. angel1 says:
    Oct 7, 2014 at 10:24 am

    This is great! How do I create “related posts” for the custom taxonomy?

    I’m assuming I need to put a conditional php code to display related posts for the new custom taxonomy to appear only when it’s a new taxonomy post and to hide when it is a basic category/tag post since they are both sharing the same content.php file.

    Any suggestions would be greatly appreciated.

    Reply
  48. SteveMTNO says:
    Jul 19, 2014 at 12:52 pm

    I used the code above to create the custom taxonomy – everything worked great. The field was added to all of my posts, and I populated it accordingly.

    I’m using the “Taxonomy Dropdown Widget” plugin – that works too.. sort of.

    The dropdown is populated correctly, but when you click on one of the items to display those posts, I get a 404. However the plugin works for displaying tags.

    Any ideas? I’ll be happy to post my code, just wasn’t sure if I paste it in here or somewhere and link to it here instead.

    Let me know.. thanks!

    SteveMTNO

    Reply
    • Ruben says:
      Aug 24, 2018 at 10:11 pm

      Go to Setting > Permalinks > Save Changes
      (don’t need to make any changes, this just rewrites your .htaccess file so the link works)
      This step should be included in the post?

      Reply
  49. David says:
    Mar 10, 2014 at 2:09 am

    Bad tutorial. You just expect people to copy/paste the code and don’t explain how it works.

    Reply
    • WPBeginner Support says:
      Mar 10, 2014 at 8:05 pm

      No, we don’t want people to just copy paste the code, we want them to study it and modify if they want.

      Reply
  50. Cletus says:
    Dec 21, 2013 at 3:51 pm

    Hi, can you recommend a different taxonomy plugin that works?
    Even a premium version, the one you’ve posted hasn’t been updated in months and the author seems to have done one.

    Reply
    • WPBeginner Support says:
      Dec 22, 2013 at 3:38 pm

      The plugin works great, and the author has 19 other plugins. It also has great reviews and we have personally tested and used it. However, if you would still like to try some other plugin, then you can look at GenerateWP which will allow you to generate the code for your custom taxonomy. You can then paste this code in your theme’s functions.php file or a site-specific plugin.

      Reply
« 1 2

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
OptinMonster
OptinMonster
Convert website visitors into email subscribers. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
LiveChat logo
LiveChat Inc Coupon
Get a 30 day free trial and 30% OFF LiveChat, one of the best live chat service providers for WordPress users.
LearnDash
LearnDash Coupon
Get the lowest price on the best learning management system (LMS) plugin for WordPress.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.