{"id":14105,"date":"2019-01-20T09:41:09","date_gmt":"2019-01-20T09:41:09","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=14105"},"modified":"2025-08-28T03:42:12","modified_gmt":"2025-08-28T03:42:12","slug":"wordpress-taxonomy","status":"publish","type":"post","link":"\/tutorials\/wordpress-taxonomy","title":{"rendered":"What is WordPress taxonomy and how to create custom ones?"},"content":{"rendered":"<p><span style=\"font-weight: 400\">WordPress taxonomy is a grouping mechanism for all of your content. In short, it allows you to group your posts based on shared characteristics. <\/span><\/p><p><span style=\"font-weight: 400\">Let&rsquo;s say that you have a website about movies. Chances are you want to group the movies based on genre. Taxonomies allow you to do just that, thus helping users to navigate your site.<\/span><\/p><p>Although the term &ldquo;Taxonomy&rdquo; does come from biology, i<span style=\"font-weight: 400\">n this article, we will explain what WordPress Taxonomy is, what Custom Taxonomies are, and how to create them.<\/span><\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-what-is-wordpress-taxonomy\">What is WordPress taxonomy?<\/h2><p>WordPress Taxonomy is a way of grouping and organizing content types into categories and tags, making it easier for users to navigate a website. Taxonomies in WordPress include categories, tags, and custom taxonomies, which can be customized to meet specific website needs.<\/p><h3 class=\"wp-block-heading\" id=\"h-types-of-wordpress-taxonomies\">Types of WordPress taxonomies<\/h3><p><span style=\"font-weight: 400\">In total, there are four taxonomies in <a href=\"\/tutorials\/what-is-wordpress\">WordPress<\/a> that you can use to group your posts.<\/span> <span style=\"font-weight: 400\">Let&rsquo;s take a look at each one.<\/span><\/p><h4 class=\"wp-block-heading\" id=\"h-1-category\"><b>1. Category<\/b><\/h4><p>The category taxonomy in WordPress lets you group your post into hierarchical categories. There are two different ways to group your posts via Categories.<\/p><p><span style=\"font-weight: 400\">The first way is to log in to your Dashboard and head to <\/span><b>Posts<\/b><span style=\"font-weight: 400\">&nbsp;-&gt; <\/span><b>Categories<\/b><span style=\"font-weight: 400\">. There, you can define your categories, as well as add in the <a href=\"\/tutorials\/what-is-a-wordpress-slug\/\">WordPress slug<\/a> and define child categories. &nbsp;<\/span><\/p><div class=\"wp-block-image wp-image-14188 size-full\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"580\" height=\"559\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/adding-categories-wordpress-plugin.jpg\/public\" alt=\"adding categories from posts menu\" class=\"wp-image-14188\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/adding-categories-wordpress-plugin.jpg\/w=580,fit=scale-down 580w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/adding-categories-wordpress-plugin.jpg\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/adding-categories-wordpress-plugin.jpg\/w=300,fit=scale-down 300w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><figcaption class=\"wp-element-caption\">Adding categories and setting the parent-child relation.<\/figcaption><\/figure><\/div><p><span style=\"font-weight: 400\">The second option is to head to <\/span><b>Posts<\/b><span style=\"font-weight: 400\">&nbsp;-&gt; <\/span><b>Add New<\/b><span style=\"font-weight: 400\">. You can add multiple categories directly from the panel next to your visual editor. While it is the easier option, it doesn&rsquo;t let you define the slug and description.<\/span><\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"277\" height=\"330\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/categories-visual-editor-wordpress-taxonomy.jpg\/public\" alt=\"adding categories from the visual editor\" class=\"wp-image-14189\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/categories-visual-editor-wordpress-taxonomy.jpg\/w=277,fit=scale-down 277w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/categories-visual-editor-wordpress-taxonomy.jpg\/w=126,fit=scale-down 126w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/categories-visual-editor-wordpress-taxonomy.jpg\/w=252,fit=scale-down 252w\" sizes=\"(max-width: 277px) 100vw, 277px\" \/><\/figure><\/div><h4 class=\"wp-block-heading\" id=\"h-2-tag\"><b>2. Tag<\/b><\/h4><p><span style=\"font-weight: 400\">Tags are similar to categories &ndash; it groups your posts. However, a <a href=\"\/tutorials\/difference-between-wordpress-categories-and-tags\">tag is different from a category<\/a> as it doesn&rsquo;t have a hierarchical structure.<\/span><\/p><p><span style=\"font-weight: 400\">A tag is a single parameter that puts your similar posts together, but it focuses on smaller details of your content, rather than overall themes.<\/span><\/p><p><span style=\"font-weight: 400\">Let&rsquo;s say that you want to create genres and subgenres for your movie WordPress site. You can do that by using category like taxonomy, as it supports hierarchical structure. If you want to group movies of any genre with Brad Pitt as the main star, you can add tags.<\/span><\/p><p><span style=\"font-weight: 400\">Creating <a href=\"\/tutorials\/wordpress-tags\">WordPress tags<\/a> is similar to creating categories. You can do it either from <\/span><b>Posts<\/b><span style=\"font-weight: 400\">&nbsp;-&gt; <\/span><b>Tags <\/b><span style=\"font-weight: 400\">or panel next to the visual editor. Slug and description can also be defined.<\/span><\/p><div class=\"wp-block-image size-full wp-image-14190\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"277\" height=\"257\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/tags-visual-editor-wordpress-taxonomy.jpg\/public\" alt=\"adding tags from the visual editor\" class=\"wp-image-14190\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/tags-visual-editor-wordpress-taxonomy.jpg\/w=277,fit=scale-down 277w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/tags-visual-editor-wordpress-taxonomy.jpg\/w=150,fit=scale-down 150w\" sizes=\"(max-width: 277px) 100vw, 277px\" \/><figcaption class=\"wp-element-caption\">Adding tags from the visual editor<\/figcaption><\/figure><\/div><p><span style=\"font-weight: 400\"><\/span><\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>While tags are optional, categories are mandatory for your posts. Every post needs at least one category. By default, WordPress will automatically put your post under &ldquo;Uncategorized&rdquo; category.<\/p>\n                <\/div>\n\n\n\n<\/p><p><span style=\"font-weight: 400\">The other 2 taxonomies are not visible to visitors. Although rarely used, they are still worth mentioning.<\/span><\/p><h4 class=\"wp-block-heading\" id=\"h-3-link-category\"><b>3. Link_category<\/b><\/h4><p><span style=\"font-weight: 400\">This taxonomy lets you categorize your links. If you link to many sources on your posts, you&rsquo;ll find this feature particularly useful.<\/span><\/p><h4 class=\"wp-block-heading\" id=\"h-4-post-format\"><b>4. Post_format<\/b><\/h4><p><span style=\"font-weight: 400\">Post_format enables you to categorize your posts based on the types <\/span><span style=\"font-weight: 400\">&ndash; videos, standard, audio, and more. You can find the panel next to your visual editor.<\/span><\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"277\" height=\"280\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/format-wordpress-taxonomy.jpg\/public\" alt=\"format taxonomy\" class=\"wp-image-14191\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/format-wordpress-taxonomy.jpg\/w=277,fit=scale-down 277w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/format-wordpress-taxonomy.jpg\/w=148,fit=scale-down 148w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/format-wordpress-taxonomy.jpg\/w=120,fit=scale-down 120w\" sizes=\"(max-width: 277px) 100vw, 277px\" \/><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-what-are-the-benefits-of-wordpress-taxonomies\">What are the benefits of WordPress taxonomies?<\/h3><p>Taxonomies in WordPress &mdash; categories, tags, and custom taxonomies &mdash; give your content a clear structure so visitors and search engines can understand how everything connects. Here&rsquo;s what you gain when you use them well:<\/p><ul class=\"wp-block-list\">\n<li><strong>Organized content structure<\/strong> &ndash; Taxonomies group posts by topic or type, so every piece has a clear home. This keeps large libraries tidy and easier to maintain as your site grows.<\/li>\n\n\n\n<li><strong>Faster navigation and discovery<\/strong> &ndash; Category and tag archives help readers jump straight to related content. Clear labels reduce pogo-sticking and keep people exploring more pages.<\/li>\n\n\n\n<li><strong>Stronger SEO foundations<\/strong> &ndash; Grouping related posts creates topical clusters that signal relevance to search engines. Archive pages, internal links, and breadcrumbs all benefit from consistent terms.<\/li>\n\n\n\n<li><strong>Scalable site architecture<\/strong> &ndash; A logical hierarchy (for example, Parent Category &rarr; Subcategory) keeps URLs clean and predictable. It also makes redesigns and content migrations less risky.<\/li>\n\n\n\n<li><strong>Dynamic content and automation<\/strong> &ndash; You can query posts by taxonomy to auto-build landing pages, &ldquo;related posts,&rdquo; and menus. Update a term once and the change rolls out wherever that query appears.<\/li>\n\n\n\n<li><strong>Powerful filtering and search<\/strong> &ndash; In WooCommerce or custom post types, taxonomies drive filters like brand, size, level, or topic. Visitors narrow results quickly without reading every page.<\/li>\n\n\n\n<li><strong>Editorial consistency<\/strong> &ndash; Shared term lists keep writers aligned on naming and scope. It&rsquo;s easier to spot content gaps and avoid duplicates when everything follows the same map.<\/li>\n\n\n\n<li><strong>Cleaner analytics and insights<\/strong> &ndash; Segment performance by category or tag to see what resonates. These slices reveal winning topics and underperforming areas to improve.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-custom-wordpress-taxonomies\">Custom WordPress taxonomies<\/h2><p><span style=\"font-weight: 400\">At the right side of your visual editor, you can see the &ldquo;Categories&rdquo; and &ldquo;Tags&rdquo; label. What if you want to have your own taxonomy that says &ldquo;People&rdquo;? <\/span><span style=\"font-weight: 400\">Here&rsquo;s where custom taxonomy saves the day. You can customize your taxonomy to better accommodate your needs.<\/span><\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"277\" height=\"164\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/people-tag-wordpress-taxonomy.jpg\/public\" alt=\"Customized people taxonomy\" class=\"wp-image-14192\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/people-tag-wordpress-taxonomy.jpg\/w=277,fit=scale-down 277w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/people-tag-wordpress-taxonomy.jpg\/w=150,fit=scale-down 150w\" sizes=\"(max-width: 277px) 100vw, 277px\" \/><\/figure><\/div><p><span style=\"font-weight: 400\">For example, think of a fitness WordPress site. Instead of having a general taxonomy that says &ldquo;categories&rdquo;, it would be better to have custom taxonomies that say &ldquo;Cardio&rdquo; and &ldquo;Floor Exercises&rdquo;. Each taxonomy can be further modified with sub-categories like &ldquo;Jogging&rdquo;, &ldquo;Intermittent running&rdquo;, and &ldquo;Crunches&rdquo;. The same case goes with tags. You can have a tag that says &ldquo;Fitness Instructor&rdquo; instead of the default names.<\/span><\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-create-custom-taxonomies-in-wordpress\">How to create custom taxonomies in WordPress<\/h2><p><span style=\"font-weight: 400\">There are two different ways of creating Custom Taxonomies in WordPress. You can do it with plugins, or you can do it through coding. <\/span><\/p><h3 class=\"wp-block-heading\" id=\"h-using-plugins-to-create-custom-taxonomies\">Using plugins to create custom taxonomies<\/h3><p><span style=\"font-weight: 400\">Plugins make everything easy and creating a custom taxonomy is no exception. You don&rsquo;t need any technical knowledge to do it. <\/span><\/p><p><span style=\"font-weight: 400\">The recommended plugins for creating custom taxonomies are <a href=\"https:\/\/wordpress.org\/plugins\/custom-post-type-ui\/\" target=\"_blank\" rel=\"noopener\">Custom Post Types UI<\/a>&nbsp;and Pods. Let&rsquo;s try using the former for the example.<\/span><\/p><ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">Install and activate Custom Post Types UI<\/span><\/li>\n\n\n\n<li>Head to <strong>CPT UI<\/strong>&nbsp;-&gt;&nbsp;<strong>Add\/Edit Taxonomies<\/strong><\/li>\n\n\n\n<li>Complete the box with your taxonomy name. In our case, we use &ldquo;Floor Exercise&rdquo;. Also, choose the custom post types on which you want to apply the new taxonomy.<img decoding=\"async\" width=\"843\" height=\"583\" class=\"aligncenter size-full wp-image-14193\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-taxonomies-wordpress-taxonomy.jpg\" alt=\"creating custom taxonomies with CTP UI\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-taxonomies-wordpress-taxonomy.jpg\/w=843,fit=scale-down 843w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-taxonomies-wordpress-taxonomy.jpg\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-taxonomies-wordpress-taxonomy.jpg\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-taxonomies-wordpress-taxonomy.jpg\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 843px) 100vw, 843px\" \/><\/li>\n\n\n\n<li>Hit&nbsp;<strong>Add Taxonomy<\/strong> button at the bottom.<\/li>\n\n\n\n<li>If you head to <strong>Posts<\/strong>&nbsp;-&gt; <strong>Add New<\/strong>, the new taxonomy will appear next to the visual editor.<img decoding=\"async\" width=\"900\" height=\"396\" class=\"aligncenter size-full wp-image-14194\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-wordpress-taxonomy.jpg\" alt=\"floor exercise new taxonomy on visual editor\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-wordpress-taxonomy.jpg\/w=900,fit=scale-down 900w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-wordpress-taxonomy.jpg\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-wordpress-taxonomy.jpg\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-wordpress-taxonomy.jpg\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/li>\n<\/ol><p>You may notice that the new taxonomy is a <strong>tag<\/strong> called &ldquo;Floor Exercise&rdquo;. What if you want to create a category instead? Easy! Scroll down a bit and change <strong>Hierarchical&nbsp;<\/strong>to <strong>True<\/strong>.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"842\" height=\"327\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-categories-wordpress-taxonomy.jpg\/public\" alt=\"changing tags to categories in CTP UI\" class=\"wp-image-14195\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-categories-wordpress-taxonomy.jpg\/w=842,fit=scale-down 842w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-categories-wordpress-taxonomy.jpg\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-categories-wordpress-taxonomy.jpg\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/custom-categories-wordpress-taxonomy.jpg\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 842px) 100vw, 842px\" \/><\/figure><\/div><p>The result will look like this:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"277\" height=\"299\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-category-wordpress-taxonomy.jpg\/public\" alt=\"floor exercise custom categories\" class=\"wp-image-14196\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-category-wordpress-taxonomy.jpg\/w=277,fit=scale-down 277w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/01\/floor-exercise-category-wordpress-taxonomy.jpg\/w=139,fit=scale-down 139w\" sizes=\"(max-width: 277px) 100vw, 277px\" \/><\/figure><\/div><p>You can also use the plugin to create <a href=\"\/tutorials\/wordpress-custom-post-types\">Custom Post Types<\/a>.<\/p><h3 class=\"wp-block-heading\" id=\"h-adding-code-to-functions-php\"><b>Adding code to functions.php<\/b><\/h3><p><span style=\"font-weight: 400\">You should choose this method only if you are comfortable with coding. If not, ignore this tutorial and stick to using plugins only.<\/span><\/p><p><span style=\"font-weight: 400\">For advanced users, you only need to add a few lines of the <strong>functions.php<\/strong> file of your theme&rsquo;s directory. Please be aware that the codes for the hierarchical taxonomy are different from the non-hierarchical one. <\/span><\/p><p><span style=\"font-weight: 400\">Take a look at the example below.<\/span><\/p><p><b>Hierarchical taxonomy (category):<\/b><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/hook into the init action and call create_book_taxonomies when it fires\nadd_action( 'init', 'create_topics_hierarchical_taxonomy', 0 );\n\n\/\/create a custom taxonomy name it topics for your posts\nfunction create_topics_hierarchical_taxonomy() {\n\n\/\/ Add new taxonomy, make it hierarchical like categories\n\n\/\/first do the translations part for GUI\n&nbsp;$labels = array(\n&nbsp;&nbsp;&nbsp;'name' =_x( 'Topics', 'taxonomy general name' ),\n&nbsp;&nbsp;&nbsp;'singular_name' =_x( 'Topic', 'taxonomy singular name' ),\n&nbsp;&nbsp;&nbsp;'search_items' =__( 'Search Topics' ),\n&nbsp;&nbsp;&nbsp;'all_items' =__( 'All Topics' ),\n&nbsp;&nbsp;&nbsp;'parent_item' =__( 'Parent Topic' ),\n&nbsp;&nbsp;&nbsp;'parent_item_colon' =__( 'Parent Topic:' ),\n&nbsp;&nbsp;&nbsp;'edit_item' =__( 'Edit Topic' ),\n&nbsp;&nbsp;&nbsp;'update_item' =__( 'Update Topic' ),\n&nbsp;&nbsp;&nbsp;'add_new_item' =__( 'Add New Topic' ),\n&nbsp;&nbsp;&nbsp;'new_item_name' =__( 'New Topic Name' ),\n&nbsp;&nbsp;&nbsp;'menu_name' =__( 'Topics' ),\n&nbsp;); &nbsp;\n\n\/\/ Now register the taxonomy\n&nbsp;register_taxonomy('topics',array('post'), array(\n&nbsp;&nbsp;&nbsp;'hierarchical' =true,\n&nbsp;&nbsp;&nbsp;'labels' =$labels,\n&nbsp;&nbsp;&nbsp;'show_ui' =true,\n&nbsp;&nbsp;&nbsp;'show_admin_column' =true,\n&nbsp;&nbsp;&nbsp;'query_var' =true,\n&nbsp;&nbsp;&nbsp;'rewrite' =array( 'slug' = 'topic' ),\n&nbsp;));\n}<\/pre><p><b>Non-hierarchical taxonomy (tag)<\/b><span style=\"font-weight: 400\">:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/hook into the init action and call create_book_taxonomies when it fires\nadd_action( 'init', 'create_topics_hierarchical_taxonomy', 0 );\n\n\/\/create a custom taxonomy name it topics for your posts\nfunction create_topics_hierarchical_taxonomy() {\n\n\/\/ Add new taxonomy, make it hierarchical like categories\n\n\/\/first do the translations part for GUI\n&nbsp;$labels = array(\n&nbsp;&nbsp;&nbsp;'name' =_x( 'Topics', 'taxonomy general name' ),\n&nbsp;&nbsp;&nbsp;'singular_name' =_x( 'Topic', 'taxonomy singular name' ),\n&nbsp;&nbsp;&nbsp;'search_items' =__( 'Search Topics' ),\n&nbsp;&nbsp;&nbsp;'all_items' =__( 'All Topics' ),\n&nbsp;&nbsp;&nbsp;'parent_item' =__( 'Parent Topic' ),\n&nbsp;&nbsp;&nbsp;'parent_item_colon' =__( 'Parent Topic:' ),\n&nbsp;&nbsp;&nbsp;'edit_item' =__( 'Edit Topic' ),\n&nbsp;&nbsp;&nbsp;'update_item' =__( 'Update Topic' ),\n&nbsp;&nbsp;&nbsp;'add_new_item' =__( 'Add New Topic' ),\n&nbsp;&nbsp;&nbsp;'new_item_name' =__( 'New Topic Name' ),\n&nbsp;&nbsp;&nbsp;'menu_name' =__( 'Topics' ),\n&nbsp;); &nbsp;\n\n\/\/ Now register the taxonomy\n&nbsp;register_taxonomy('topics',array('post'), array(\n&nbsp;&nbsp;&nbsp;'hierarchical' =true,\n&nbsp;&nbsp;&nbsp;'labels' =$labels,\n&nbsp;&nbsp;&nbsp;'show_ui' =true,\n&nbsp;&nbsp;&nbsp;'show_admin_column' =true,\n&nbsp;&nbsp;&nbsp;'query_var' =true,\n&nbsp;&nbsp;&nbsp;'rewrite' =array( 'slug' = 'topic' ),\n&nbsp;));\n}<\/pre><p><span style=\"font-weight: 400\">To show the new taxonomy in your visual editor, open single.php from Editor and copy this code:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">the_terms( $post-ID, 'topics', 'Topics: ', ', ', ' ' );<\/pre><p><span style=\"font-weight: 400\">That&rsquo;s it! If the process is done correctly, a new taxonomy called &ldquo;Topic&rdquo; will appear on your visual editor.<\/span><\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p><span style=\"font-weight: 400\">WordPress Taxonomy is used to group your content. You can use categories for broad topics, and tags for details in your text. You can also create custom taxonomies using plugins or <strong>functions.php<\/strong> file.<\/span><\/p><p><span style=\"font-weight: 400\">Correctly utilizing WordPress taxonomies will help boost your website&rsquo;s user experience.<\/span><\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Learn What Else You Can Do With WordPress<\/h4>\n                    <p><a href=\"\/tutorials\/wordpress\/how-to-login-to-wordpress-dashboard\">How to Login to WordPress<\/a><br>\n<a href=\"\/tutorials\/wordpress\/how-to-schedule-posts-in-wordpress\">How to Schedule Posts in WordPress<\/a><br>\n<a href=\"\/tutorials\/how-to-add-wordpress-related-posts\">How to Add WordPress Related Posts<\/a><br>\n<a href=\"\/tutorials\/wordpress-menu-icons\">2 Methods on Adding WordPress Menu Icons\"<\/a><br>\n<a href=\"\/tutorials\/how-to-reinstall-wordpress\">How to Reinstall WordPress<\/a><br>\n<a href=\"\/tutorials\/wordpress\/how-to-add-facebook-like-button-to-wordpress\">How to Add Facebook Like Button to WordPress<\/a><br>\n<a href=\"\/tutorials\/install-wordpress-on-subdomain\">How to Install WordPress on a Subdomain<\/a><br>\n<a href=\"\/tutorials\/wordpress-favicon\">Guide to WordPress Favicons<\/a><br>\n<a href=\"\/tutorials\/create-manage-wordpress-user-roles-permissions\">How to Manage User Roles and Permissions in WordPress<\/a><\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress taxonomy is a grouping mechanism for all of your content. In short, it allows you to group your posts [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/tutorials\/wordpress-taxonomy\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":75210,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"What Is WordPress Taxonomy and How to Create a Custom One","rank_math_description":"WordPress taxonomy is used to group posts types together based upon characteristics that the posts share. Read this article to learn more!","rank_math_focus_keyword":"wordpress taxonomy","footnotes":""},"categories":[22642,22637],"tags":[],"class_list":["post-14105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-content-creation","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/wordpress-taxonomy","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/taxonomie-wordpress","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/taxonomia-wordpress","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/apa-itu-taksonomi-wordpress","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/wordpress-taxonomy","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/wordpress-taxonomy\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/wordpress-taxonomy\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/taxonomia-wordpress","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/taxonomia-wordpress","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/taxonomia-wordpress","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/wordpress-taxonomy","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/wordpress-taxonomy","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/wordpress-taxonomy","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/wordpress-taxonomy","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/14105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/comments?post=14105"}],"version-history":[{"count":31,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/14105\/revisions"}],"predecessor-version":[{"id":133182,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/14105\/revisions\/133182"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media\/75210"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media?parent=14105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/categories?post=14105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/tags?post=14105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}