{"id":112267,"date":"2020-11-20T20:59:34","date_gmt":"2020-11-21T02:59:34","guid":{"rendered":"https:\/\/wpengine.com\/?post_type=resource&#038;p=112267"},"modified":"2025-01-07T14:50:26","modified_gmt":"2025-01-07T20:50:26","slug":"how-to-create-custom-taxonomies-in-wordpress","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/","title":{"rendered":"How to Create Custom Taxonomies in WordPress"},"content":{"rendered":"\n<p>Content in WordPress can usually be gathered into distinct groups. Most of your posts and pages will be assigned to a type of \u2018taxonomy\u2019 \u2013 i.e. a category or tag \u2013 that already exists. However, you might also need to create a custom WordPress taxonomy.<\/p>\n\n\n\n<p>Fortunately, the process for doing this is straightforward. Knowing how to create and update taxonomies will enable you to better organize your site, and help visitors find what they\u2019re looking for more quickly.<\/p>\n\n\n\n\n\n<p>In this article, we\u2019ll look at how to create a custom WordPress taxonomy. However, before that, let\u2019s discuss what a taxonomy is in more detail!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is a WordPress taxonomy?<\/h2>\n\n\n\n<p>A <a href=\"https:\/\/wordpress.org\/support\/article\/taxonomies\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress taxonomy<\/a> is a way to organize posts and other content. The two most common types are categories and tags. Categories are designed for grouping similar posts together, while tags (much like hashtags) describe what a specific post contains.<\/p>\n\n\n\n<p>Most WordPress websites use these built-in taxonomies for organizing content. This is useful to both you and your visitors, since it helps everyone find what they want more efficiently. What\u2019s more, grouping your content this way can even benefit your site\u2019s <a href=\"https:\/\/yoast.com\/taxonomy-seo-categories-tags\/\" target=\"_blank\" rel=\"noreferrer noopener\">Search Engine Optimization (SEO)<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a custom taxonomy with a plugin<\/h2>\n\n\n\n<p>Categories and tags are great, but what if you want other ways to organize your content? As is standard for WordPress, there are both user-friendly and developer-friendly ways to create a custom taxonomy.<\/p>\n\n\n\n<p>We\u2019re going to cover the plugin approach first. The first step is to choose your desired tool. We\u2019ll use the free <a href=\"https:\/\/www.advancedcustomfields.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Advanced Custom Fields<\/a> (ACF) plugin, based on its flexibility and ease of use. ACF is a complete content modeling solution, allowing you to create not just custom taxonomies, but custom post types and over 30 different custom field types to customize your site.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Add a new blank taxonomy and populate the fields<\/h3>\n\n\n\n<p>To get started, you\u2019ll want to <a href=\"https:\/\/www.advancedcustomfields.com\/downloads\/\" target=\"_blank\" rel=\"noreferrer noopener\">download<\/a> the latest version of ACF, and then <a href=\"https:\/\/www.advancedcustomfields.com\/blog\/installing-and-upgrading-to-the-latest-version-of-acf\/\" target=\"_blank\" rel=\"noreferrer noopener\">install and activate<\/a> the plugin. Once you\u2019ve done that, head to the <em>ACF Taxonomies<\/em> screen within your WordPress dashboard:<span id=\"docs-internal-guid-162a308b-7fff-8571-4602-11f1137c2cec\"><div><span style=\"font-size: 12pt;font-family: Arial, sans-serif;background-color: transparent;vertical-align: baseline\"><\/span><\/div><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1990\" height=\"1134\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2020\/11\/ACF-create-custom-taxonomy.png\" alt=\"The Taxonomies screen within the ACF plugin. No taxonomies have been created at this point, so the text reads &quot;Add Your First Taxonomy&quot; and &quot;Create custom taxonomies to classify post type content.&quot; Buttons labeled &quot;Add New&quot; and &quot;Add Taxonomy&quot; are shown, allowing users to create new taxonomies. \" class=\"wp-image-155054\" style=\"width:877px;height:auto\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-create-custom-taxonomy.png 1990w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-create-custom-taxonomy-540x308.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-create-custom-taxonomy-1024x584.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-create-custom-taxonomy-768x438.png 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-create-custom-taxonomy-1536x875.png 1536w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-create-custom-taxonomy-1500x855.png 1500w\" sizes=\"auto, (max-width: 1990px) 100vw, 1990px\" \/><\/figure>\n\n\n\n<p>Next, click <em>Add Taxonomy<\/em> or <em>Add New<\/em>.&nbsp;<\/p>\n\n\n\n<p>Fill in the required fields for <em>Plural Label<\/em>, <em>Singular Label<\/em>, and <em>Taxonomy Key<\/em> (for example, \u201cRecipes,\u201d and \u201cRecipe,\u201d and \u201crecipe\u201d respectively).<\/p>\n\n\n\n<p>Clicking the <em>Post Types<\/em> field will open a dropdown that allows you to select one or more of the existing post types on your site. The plugin will not force you to select a post type, but the taxonomy will not be available if you don\u2019t. For now, we\u2019ll just select <em>Posts<\/em>.<\/p>\n\n\n\n<p>There are also three toggle switches: <em>Public<\/em>, <em>Hierarchical<\/em>, and <em>Advanced Configuration<\/em>. \u201cPublic\u201d is toggled on by default. Switch on \u201cHierarchical\u201d if you want to create further custom taxonomies that have parent-child relationships. For example, you could create a custom taxonomy for \u201cRecipes,\u201d and then a child custom taxonomy within that called \u201cVegetarian Recipes.\u201d&nbsp;&nbsp;<\/p>\n\n\n\n<p>The third toggle switch, <em>Advanced Configuration<\/em>, gives you even greater control of how your custom taxonomy works. Please see the ACF documentation for more information on <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/registering-a-custom-taxonomy\/#advanced-configuration\" target=\"_blank\" rel=\"noreferrer noopener\">advanced configuration for custom taxonomies<\/a>.<\/p>\n\n\n\n<p>Once you\u2019ve filled in the necessary fields, click <em>Save Changes<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1950\" height=\"1412\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-Ready-to-Save.png\" alt=\"The Edit Taxonomy screen within the ACF plugin. The fields and toggle switches are as described in the text of the article. \" class=\"wp-image-155057\" style=\"width:809px;height:auto\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-Ready-to-Save.png 1950w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-Ready-to-Save-540x391.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-Ready-to-Save-1024x741.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-Ready-to-Save-768x556.png 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-Ready-to-Save-1536x1112.png 1536w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-Ready-to-Save-1500x1086.png 1500w\" sizes=\"auto, (max-width: 1950px) 100vw, 1950px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Extend your custom taxonomy <\/h3>\n\n\n\n<p>Your new taxonomy is now ready for use. ACF gives you a notification, as well as some handy links to add custom fields, link existing field groups, create or duplicate taxonomies, and create a custom post type.&nbsp;<\/p>\n\n\n\n<p>The new taxonomy will be visible when editing any of the associated post types. Since we added it to \u201cPosts,\u201d we can see it when we create a new post:&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1490\" height=\"1266\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-in-Posts.png\" alt=\"The WordPress post editor screen, showing the newly created &quot;Recipes&quot; taxonomy.\" class=\"wp-image-155058\" style=\"width:787px;height:auto\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-in-Posts.png 1490w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-in-Posts-540x459.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-in-Posts-1024x870.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomy-in-Posts-768x653.png 768w\" sizes=\"auto, (max-width: 1490px) 100vw, 1490px\" \/><\/figure>\n\n\n\n<p>You can see all your custom taxonomies by clicking <em>ACF &gt; Taxonomies. <\/em>You can also make edits to your existing taxonomies by clicking on them in this screen.&nbsp;<br><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1896\" height=\"1262\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomies-Screen.png\" alt=\"The Taxonomies screen in the ACF plugin, this time showing the &quot;Recipes&quot; taxonomy created in the previous step. \" class=\"wp-image-155059\" style=\"width:857px;height:auto\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomies-Screen.png 1896w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomies-Screen-540x359.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomies-Screen-1024x682.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomies-Screen-768x511.png 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomies-Screen-1536x1022.png 1536w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/ACF-Custom-Taxonomies-Screen-1500x998.png 1500w\" sizes=\"auto, (max-width: 1896px) 100vw, 1896px\" \/><\/figure>\n\n\n\n<p>With that, your new taxonomy is set up and ready to go.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a custom taxonomy with code<\/h2>\n\n\n\n<p>If you\u2019d rather not use a plugin, or if you\u2019re a developer who finds the manual approach easier, you can create your custom taxonomies with code. The steps below are simple to implement, especially if you have previous experience navigating WordPress\u2019 core files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Determine if you want a hierarchical or non-hierarchical taxonomy<\/h3>\n\n\n\n<p>First, you\u2019ll want to decide whether your taxonomy will be hierarchical or not. Here\u2019s a quick summary of the differences:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Hierarchical.<\/strong> This lets you have parent and child terms, just as with categories. For example, you could have a parent term called <em>Beginners<\/em>, and child terms such as <em>Plugins<\/em>, <em>Themes<\/em>, and <em>Marketing<\/em>.<\/li>\n\n\n\n<li><strong>Non-Hierarchical.<\/strong> Like tags, this only lets you define one term to assign to content, without letting you create child terms.<\/li>\n<\/ul>\n\n\n\n<p>This decision matters, since the code you\u2019ll need is slightly different depending on your preference.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Edit your functions.php file<\/h3>\n\n\n\n<p>Regardless of your taxonomies\u2019 nature, you\u2019ll need access to your <em>functions.php<\/em> file. Before you begin:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Make sure you <a href=\"https:\/\/wpengine.com\/resources\/how-to-backup-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">back up your website<\/a> before carrying out any work on core files.<\/li>\n\n\n\n<li>Use a <a href=\"https:\/\/wpengine.com\/resources\/create-child-theme-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">child theme<\/a> to preserve your changes when updating themes and WordPress itself.<\/li>\n\n\n\n<li>Brush up on your <a href=\"https:\/\/wpengine.com\/resources\/how-to-access-wordpress-files-using-sftp\/\" target=\"_blank\" rel=\"noreferrer noopener\">Secure File Transfer Protocol (SFTP)<\/a> knowledge if needed, and have a dedicated SFTP client to hand (such as <a href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">FileZilla<\/a> or <a href=\"https:\/\/cyberduck.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cyberduck<\/a>).<\/li>\n<\/ul>\n\n\n\n<p>Then you can log in to your WordPress website through SFTP, and look for your <em>functions.php<\/em> file. It should be within your primary theme\u2019s folder. Open the file once you\u2019ve found it, and add one of the <a href=\"https:\/\/www.wpbeginner.com\/wp-tutorials\/create-custom-taxonomies-wordpress\/#plugin\" target=\"_blank\" rel=\"noreferrer noopener\">following code snippets<\/a> to the bottom, depending on whether you chose a hierarchical taxonomy or not.<\/p>\n\n\n\n<p><strong>Hierarchical:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>\/\/ Hook into the init action and call create_book_taxonomies when it firesadd_action( 'init', 'create_subjects_hierarchical_taxonomy', 0 );\/\/ Create a custom taxonomy name for your postsfunction create_subjects_hierarchical_taxonomy() {\/\/ Add a new taxonomy and make it hierarchical, like Categories\/\/ Translate the GUI&nbsp;&nbsp;&nbsp;$labels = array(&nbsp;&nbsp;&nbsp;&nbsp;'name' =&gt; _x( 'Subjects', 'taxonomy general name' ),&nbsp;&nbsp;&nbsp;&nbsp;'singular_name' =&gt; _x( 'Subject', 'taxonomy singular name' ),&nbsp;&nbsp;&nbsp;&nbsp;'search_items' =&gt;&nbsp; __( 'Search Subjects' ),&nbsp;&nbsp;&nbsp;&nbsp;'all_items' =&gt; __( 'All Subjects' ),&nbsp;&nbsp;&nbsp;&nbsp;'parent_item' =&gt; __( 'Parent Subject' ),&nbsp;&nbsp;&nbsp;&nbsp;'parent_item_colon' =&gt; __( 'Parent Subject:' ),&nbsp;&nbsp;&nbsp;&nbsp;'edit_item' =&gt; __( 'Edit Subject' ),&nbsp;&nbsp;&nbsp;&nbsp;'update_item' =&gt; __( 'Update Subject' ),&nbsp;&nbsp;&nbsp;&nbsp;'add_new_item' =&gt; __( 'Add New Subject' ),&nbsp;&nbsp;&nbsp;&nbsp;'new_item_name' =&gt; __( 'New Subject Name' ),&nbsp;&nbsp;&nbsp;&nbsp;'menu_name' =&gt; __( 'Subjects' ),&nbsp;&nbsp;); &nbsp;\/\/ Register the taxonomy&nbsp;&nbsp;register_taxonomy('subjects',array(\u2018post_type'), array(&nbsp;&nbsp;&nbsp;&nbsp;'hierarchical' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'labels' =&gt; $labels,&nbsp;&nbsp;&nbsp;&nbsp;'show_ui' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'show_in_rest' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'show_admin_column' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'query_var' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'rewrite' =&gt; array( 'slug' =&gt; 'subject' ),&nbsp;&nbsp;));}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Non-hierarchical:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>\/\/ Hook into the init action and call create_topics_nonhierarchical_taxonomy when it firesadd_action( 'init', 'create_topics_nonhierarchical_taxonomy', 0 );function create_topics_nonhierarchical_taxonomy() {\/\/ Add Labels to the GUI&nbsp;&nbsp;$labels = array(&nbsp;&nbsp;&nbsp;&nbsp;'name' =&gt; _x( 'Topics', 'taxonomy general name' ),&nbsp;&nbsp;&nbsp;&nbsp;'singular_name' =&gt; _x( 'Topic', 'taxonomy singular name' ),&nbsp;&nbsp;&nbsp;&nbsp;'search_items' =&gt;&nbsp; __( 'Search Topics' ),&nbsp;&nbsp;&nbsp;&nbsp;'popular_items' =&gt; __( 'Popular Topics' ),&nbsp;&nbsp;&nbsp;&nbsp;'all_items' =&gt; __( 'All Topics' ),&nbsp;&nbsp;&nbsp;&nbsp;'parent_item' =&gt; null,&nbsp;&nbsp;&nbsp;&nbsp;'parent_item_colon' =&gt; null,&nbsp;&nbsp;&nbsp;&nbsp;'edit_item' =&gt; __( 'Edit Topic' ),&nbsp;&nbsp;&nbsp;&nbsp;'update_item' =&gt; __( 'Update Topic' ),&nbsp;&nbsp;&nbsp;&nbsp;'add_new_item' =&gt; __( 'Add New Topic' ),&nbsp;&nbsp;&nbsp;&nbsp;'new_item_name' =&gt; __( 'New Topic Name' ),&nbsp;&nbsp;&nbsp;&nbsp;'separate_items_with_commas' =&gt; __( 'Separate topics with commas' ),&nbsp;&nbsp;&nbsp;&nbsp;'add_or_remove_items' =&gt; __( 'Add or remove topics' ),&nbsp;&nbsp;&nbsp;&nbsp;'choose_from_most_used' =&gt; __( 'Choose from the most used topics' ),&nbsp;&nbsp;&nbsp;&nbsp;'menu_name' =&gt; __( 'Topics' ),&nbsp;&nbsp;);&nbsp;\/\/ Register the non-hierarchical taxonomy similar to a Tag&nbsp;&nbsp;register_taxonomy('topics','books',array(&nbsp;&nbsp;&nbsp;&nbsp;'hierarchical' =&gt; false,&nbsp;&nbsp;&nbsp;&nbsp;'labels' =&gt; $labels,&nbsp;&nbsp;&nbsp;&nbsp;'show_ui' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'show_in_rest' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'show_admin_column' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'update_count_callback' =&gt; '_update_post_term_count',&nbsp;&nbsp;&nbsp;&nbsp;'query_var' =&gt; true,&nbsp;&nbsp;&nbsp;&nbsp;'rewrite' =&gt; array( 'slug' =&gt; 'topic' ),&nbsp;&nbsp;));}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>You\u2019ll want to change the placeholder names in the above code to whatever you\u2019d like to use for your custom taxonomy. You can also change the <em>post_type<\/em> within the <em>register_taxonomy<\/em> function \u2013 generally this is going to be <em>Posts<\/em>, but your needs may vary.<\/p>\n\n\n\n<p>Once you save your changes, you\u2019ll need to do a little more work in order to display your taxonomies. However, before that, let\u2019s discuss how to create custom taxonomies in WooCommerce.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a custom taxonomy in WooCommerce<\/h2>\n\n\n\n<p>The good news is that creating a custom taxonomy for WooCommerce products follows almost exactly the same process as the plugin approach outlined above. Of course, you\u2019ll want to ensure that you <a href=\"https:\/\/wpengine.com\/resources\/woocommerce-tutorial\/\" target=\"_blank\" rel=\"noreferrer noopener\">have WooCommerce installed<\/a> and products uploaded to your store before carrying those steps out.&nbsp;<\/p>\n\n\n\n<p>The only change required is what happens when you get to the <em>Advanced Options<\/em> screen. This time, instead of checking <em>Posts (post)<\/em>, you\u2019ll now check <em>Products (product)<\/em>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Rtfqfixj-S3widXmSJp3uasvagjiZL-ui7y627umLEpxlu4V1BvQgylQGZczbDkmZoShXaNd7EVex-_RTUz609WvGnjmnN0yvOgWDVL2Ubfh8qQNsyXv2gRBtkqZtcFsJM5_onDC\" alt=\"This time, instead of checking Posts (post), you\u2019ll now check Products (product)\" \/><\/figure>\n\n\n\n<p>Once you save your changes, the taxonomy will be ready to use. Then, the final step is learning how to display the taxonomies you\u2019ve created.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to display taxonomies<\/h2>\n\n\n\n<p>If you\u2019ve come this far, you\u2019ll have all the skills necessary to display your taxonomies. This next set of steps involves adding some code and digging around within WordPress\u2019 templates, so make sure to back up your site if you haven\u2019t already.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Decide where the code should be displayed<\/h3>\n\n\n\n<p>For this step, you\u2019ll need some knowledge of <a href=\"https:\/\/developer.wordpress.org\/themes\/basics\/template-hierarchy\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress\u2019 template hierarchy<\/a>. This is because you\u2019ll have to add lines of code to every template where you want your custom taxonomies to display.<\/p>\n\n\n\n<p>Quite often, you\u2019ll want to amend <em>single.php<\/em>, <em>content.php<\/em>, or another file within your theme\u2019s <em>template-parts<\/em> folder. However, you could theoretically add your custom taxonomy to any template file.<\/p>\n\n\n\n<p>If you\u2019re struggling to find the template a specific page uses, the <a href=\"https:\/\/wordpress.org\/plugins\/which-template-am-i\/\" target=\"_blank\" rel=\"noreferrer noopener\">Which Template Am I<\/a> plugin can get the job done by showing you the template path within your browser. Once you\u2019ve made this decision, the final step is to add some code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Add code to where you want your taxonomy displayed<\/h3>\n\n\n\n<p>Next, you\u2019ll again want to access your theme\u2019s files via SFTP, and open the template you chose during the first step. From there, you\u2018ll have to find the spot in your file where the taxonomy should display, and paste in the following:<\/p>\n\n\n\n<p><code>&lt;?php the_terms( $post-&gt;ID, 'topics', 'Topics: ', ', ', ' ' ); ?&gt;<\/code><\/p>\n\n\n\n<p>Once you save your changes, you should see the taxonomy displayed on your WordPress website. Of course, you may need to tweak the placement slightly, but the link should still be clickable and the taxonomy registered.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Customize your site with WP Engine<\/h2>\n\n\n\n<p>Customizations within WordPress take many forms. In this article we\u2019ve discussed taxonomies, but there are many other features you can add to your site to improve its User Experience (UX).&nbsp;<\/p>\n\n\n\n<p>WP Engine\u2019s <a href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">flexible assortment of plans<\/a> gives you the freedom to create and customize your website to your own exacting standards. For more information, check out our website and see for yourself how we can help!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Content in WordPress can usually be gathered into distinct groups. Most of your posts and pages will be assigned to a type of \u2018taxonomy\u2019 \u2013 i.e. a category or tag \u2013 that already exists. However, you might also need to create a custom WordPress taxonomy. Fortunately, the process for doing this is straightforward. Knowing how<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":297,"featured_media":112268,"template":"","resource-topic":[901],"resource-role":[903],"resource-type":[916],"class_list":["post-112267","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create Custom Taxonomies in WordPress | WP Engine<\/title>\n<meta name=\"description\" content=\"Know how to create and update taxonomies will enable you to better organize your site, and help visitors find what they\u2019re looking for more quickly.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Custom Taxonomies in WordPress | WP Engine\" \/>\n<meta property=\"og:description\" content=\"Know how to create and update taxonomies will enable you to better organize your site, and help visitors find what they\u2019re looking for more quickly.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-07T20:50:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/shutterstock_1011079657-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/\",\"name\":\"How to Create Custom Taxonomies in WordPress | WP Engine\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2020-11-21T02:59:34+00:00\",\"dateModified\":\"2025-01-07T20:50:26+00:00\",\"description\":\"Know how to create and update taxonomies will enable you to better organize your site, and help visitors find what they\u2019re looking for more quickly.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Create Custom Taxonomies in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/3a22232b01de39dcf588fb8e421c0521\",\"name\":\"Erin Myers\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"caption\":\"Erin Myers\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Custom Taxonomies in WordPress | WP Engine","description":"Know how to create and update taxonomies will enable you to better organize your site, and help visitors find what they\u2019re looking for more quickly.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"How to Create Custom Taxonomies in WordPress | WP Engine","og_description":"Know how to create and update taxonomies will enable you to better organize your site, and help visitors find what they\u2019re looking for more quickly.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2025-01-07T20:50:26+00:00","og_image":[{"width":1100,"height":500,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/shutterstock_1011079657-1.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/","name":"How to Create Custom Taxonomies in WordPress | WP Engine","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2020-11-21T02:59:34+00:00","dateModified":"2025-01-07T20:50:26+00:00","description":"Know how to create and update taxonomies will enable you to better organize your site, and help visitors find what they\u2019re looking for more quickly.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/how-to-create-custom-taxonomies-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"How to Create Custom Taxonomies in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/3a22232b01de39dcf588fb8e421c0521","name":"Erin Myers","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","caption":"Erin Myers"}}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/11\/shutterstock_1011079657-2.jpg","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Marketer","topic":"<strong>Topics:<\/strong> WordPress","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/112267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/297"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/112268"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=112267"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=112267"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=112267"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=112267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}