Struggling with the question of “what is a taxonomy” as it applies to your WordPress site? Taxonomies are an important part of categorizing your WordPress site’s content, but the term often confuses beginners because “taxonomy” isn’t something most of us hear in daily life. So…what is a taxonomy? And, better yet, why should you care about taxonomies on your WordPress site? Well, let’s find out…
Here’s everything that you’ll learn in this entry. You can click on any of the links below to jump straight to that section or just read the whole way through:
- What is a WordPress Taxonomy?
- What types of taxonomies does WordPress offer by default?
- When should you use categories and tags?
- How to display taxonomies on your site
- How to create your own custom taxonomies
In the simplest sense, WordPress taxonomies are just a way to group related posts (or other pieces of content) together. That’s it! Though it’s a big word, it’s not as complicated as it sounds.
For example, if you have a blog about sports, you could create taxonomies for the different sports (football, basketball, cricket, etc.) and assign relevant posts to each taxonomy.
Taxonomies are helpful because they make it easier for readers to find related content (and also provide some context to your content, though that’s a secondary benefit).
Think about it – if someone who visits the example sports site from above is only interested in content about basketball, isn’t it pretty helpful to let them quickly click on a taxonomy to only view basketball related content? That’s much better than making them sift through tons of unrelated content about cricket, right?
If you think about it, you’ll realize that you encounter taxonomies everywhere in your digital life, even if you don’t know them by that name. For example, if you head to Amazon, you probably find it helpful that you can quickly click to the Television & Video taxonomy instead of searching through the millions of different products on Amazon.
By default, WordPress includes two types of public-facing taxonomies:
You’ll find these taxonomies on the right side of the WordPress Editor:
You can add taxonomies directly from the WordPress Editor. Or, you can always add or edit taxonomies (including permalink slugs) at a later date by hovering over the Posts option in your dashboard sidebar and selecting either Categories or Tags.
If you look at the WordPress Editor screenshot above, you might notice that the interface for adding categories and tags is actually a little bit different.
With categories, WordPress lists out all of the categories that you’ve used, while the tags interface only includes a box to add tags.
There’s actually a couple of reasons for the different interface for each option. Let’s dig in a little deeper…
First off, every single post that you write needs a category. Tags, on the other hand, are entirely optional. Again:
- Category – Required
- Tag – Optional
Additionally, categories are hierarchical, while tags aren’t. Hierarchical just means that you can add subcategories inside parent categories. So you can put categories inside other categories, but you can’t do the same for tags.
When Should You Use Categories vs Tags?
Whether you should use categories or tags depends mostly on your intended scope for the taxonomy. Categories are meant for broadly grouping your content together. It’s fairly common to have fewer than 10 main categories on your entire site. Many sites even use fewer than 5 categories!
Tags, on the other hand, can be very narrow and only apply to a specific post. You’ll find plenty of sites using hundreds of different tags across the aggregate of all of their posts.
Let’s go back to the sports website example to illustrate this concept. Say you wrote a post about Michael Jordan. Here’s an example of some taxonomies you could use for the post:
- Category: Basketball (broad)
- Tags: Michael Jordan, Chicago Bulls (narrow and specific to the post)
Can You Assign Multiple Categories to a Post?
Yes, you can assign multiple categories to a post. Therefore, a better question is, “should you assign multiple categories to a post?”. The answer there is a bit murkier…
You’ll find arguments on both sides of the issue.
As an occasional thing, using multiple categories for a post is unlikely to cause serious harm. But if you find yourself needing to assign multiple categories to nearly every single post that you write, you may want to consider whether your category system is overly narrow.
Possible solutions include shifting your narrower categories into either subcategories of a broader category or tags (depending on just how narrow the category is).
Thanks to WordPress widgets, it’s easy to display both your tags and categories on the front-end of your site.
To do that, all you need to do is head to Appearance → Widgets and drag over either (or both) the Categories and Tag Cloud widgets:
While the default WordPress install sets you up with two different taxonomies, you’re by no means limited to only using categories and tags. Through the magic of something called custom taxonomies, you can create an unlimited number of your own taxonomies.
You can structure your custom taxonomies like either categories or tags. Remember – the main difference here is that categories are hierarchical (can have subcategories as well) while tags aren’t.
Your custom taxonomies can be for literally anything. For example, if you had a WordPress site about books, you could create custom taxonomies for:
That way, your readers could easily find content related to the authors and genres that they like.
How to Create Your Own Custom Taxonomy in WordPress
Creating your own custom taxonomy is actually easier than you might think. As is usually the case with WordPress, you can go about it either:
- With the help of a plugin
- Manually with your own code
On the plugin front, you have a number of different options, with some of the most popular being:
To go the manual route, you can use the register_taxonomy() function. For a full discussion of how this function works, you can read the detailed WordPress Codex page.
Generally, it’s much simpler for a casual webmaster to use one of the aforementioned plugins. All three plugins are popular, well-supported, and easy to use.
Once you add a custom taxonomy via one of the methods above, you’ll see it as a new box in your WordPress Editor:
If you enjoyed this tutorial, then you’ll love our support. All Kinsta’s hosting plans include 24/7 support from our veteran WordPress developers and engineers. Chat with the same team that backs our Fortune 500 clients. Check out our plans