If you’ve ever opened the “posts” area of WordPress, then you’ve probably come across Categories and Tags. But there’s a lot more to taxonomies than the default options in WordPress.
So, today, we’re going to dive into the world of taxonomies to understand what they are, how they work, and how you can take your websites to the next level by registering your own custom taxonomies.
Prefer videos? Check out this article in video form!
But, let’s start at the beginning; what is a taxonomy, anyway?
What is a Taxonomy?
At the most basic level, a taxonomy is a system used to group and organize content. Taxonomies give you the ability to categorize and tag your content, which is why your default posts will come with two taxonomies: categories and tags.
Most people don’t go further than that — assuming categories and tags are enough, but there’s actually a lot of power in creating custom taxonomies.
But before we talk about that, I want to go over the vocabulary and give you an analogy that will help it all make sense.
In this article, we’re going to be talking about both “taxonomies” and “terms”.
A taxonomy is a system for grouping content. A term is a specific label within that taxonomy.
By default, you get a taxonomy of “categories” with a term of “uncategorized” as soon as you install WordPress.
A helpful analogy is to picture a file cabinet and think of each drawer as a taxonomy and individual file folders inside the drawers as terms. Then, inside those folders are all of your posts.
The way the “categories” taxonomy is set up is hierarchical; meaning you can have sub-folders within your folders. The default “tags” have a flat structure that doesn’t allow for that same parent/child relationship.
However, the taxonomy system on WordPress, differs from a filing cabinet because posts can live in multiple taxonomies and multiple terms simultaneously — which is just an advantage of being digital and not physical.
Why Use Taxonomies?
Taxonomies do more than keep things tidy—they make your content more accessible and easier to navigate for both you and your users. On a basic level, taxonomies allow you to create clear, organized pathways through your content, which can significantly improve the user experience on your site.
For example, if you run a recipe blog, using custom taxonomies to categorize by cooking method, cuisine, or difficulty level makes it much easier for your visitors to find exactly what they’re looking for (typically through taxonomy-driven navigation, filters, or archive pages).
It also helps search engines understand the structure of your content, which can improve your SEO.
Taxonomies are most useful on sites with large amounts of content or complex structures, like e-commerce sites, blogs with multiple topics, or directories. In these cases, custom taxonomies allow you to maintain a clear and logical organization, preventing content from getting lost in the shuffle.
Taxonomies in Practice
I’ve put together a fictional recipe blog for us to explore as an example.
We’ll start by just using the default taxonomies WordPress gives us; categories and tags.
For the “categories”, I’ve created terms for all the course types, like Main, Appetizer, Desserts, and Beverages. All of these could have child or sub-categories, but for the sake of the demo, I’ve only added the parent/child relationship to Beverages, which has child terms of Cocktails, Smoothies, and Hot Drinks.
Side Note: Until I was doing research for this post, if I wanted to use a child term, I would always select both the child and the parent it belongs to; that’s not necessary. If you choose a child term, it will be automatically associated with its parent term. Just saved you a click!
These are the more broad terms that all of my recipes will belong to.
As for the “tags”, I’ve decided to use that system for dietary preferences like vegetarian, gluten-free, and low-carb. These attributes are not hierarchical and are used more like labels to highlight specific qualities of a recipe.
And while you might think this is enough (and it may be in some scenarios), let’s say your audience keeps asking for a way to organize your recipes by cooking method.
Sure, you could just start adding more terms inside your categories or tags for various cooking methods (like grilling, baking, or stove top) — but mixing two entirely different concepts (like course types and cooking methods) inside one taxonomy can cause issues by making the categories tab messy and making it less obvious to know which terms to select.
That problem only snowballs once you decide to also organize them by cuisine (like American, Mexican, and Italian) and by difficulty level (like Beginner, Intermediate, and Advanced).
Suddenly, the taxonomy system you implemented to keep things organized has become a cluttered junk drawer.
This, my friend, is where custom taxonomies come to save the day!
How to Create Custom Taxonomies (Using Advanced Custom Fields)
WordPress ships with “categories” and “tags,” but we’re by no means limited to just those taxonomies. Tools like Advanced Custom Fields give us an easy and free way to create our own taxonomies.
And, in fact, you may find you only want to use custom taxonomies and hide away categories and tags to create a more thoughtful and purpose-made system (here’s how you can get rid of the default categories and tags if you don’t want to use them — but that can cause complications if your theme relies on those being there, so make sure you understand the implications before deregistering any taxonomies).
But before we start blowing up our install, let’s take a look at how to register our custom taxonomies.
First, head to your plugins and click Add New. We’re going to search for Advanced Custom Fields and install and activate the free version directly from the WordPress repo.
Next, we’ll hover over our new ACF menu item and click “Taxonomies”:
Since we don’t have any custom taxonomies, our only option is to create a new taxonomy, so click the Add Taxonomy button.
We’ll start with our Cooking Method taxonomy. So, for the Plural Label, I’ll type in “Cooking Methods”, for the Singular Label, we’ll type “Cooking Method”, and the auto-generated Taxonomy Key of “cooking-method” is fine.
Next, we’ll need to assign this taxonomy to the post types we want it to be available to. In this case, we’re just going to select “Posts” since all of our recipes are done with the default WordPress posts — but you can assign this to pages or media, and if you have any custom post types, you’ll see those on this list as well.
In fact, custom taxonomies go hand-in-hand with custom post types.
Lastly, we need to decide whether our Cooking Methods taxonomy should be hierarchical or not. Remember, hierarchical taxonomies allow us to create parent/child relationships among our terms, while non-hierarchical taxonomies maintain a flat structure.
Hierarchical and non-hierarchical taxonomies also have different UIs inside your posts. I’ve always found the checkbox system of hierarchical taxonomies easier to use. Non-hierarchical taxonomies rely on a search function, which can make it difficult to keep track of your terms and often leads to duplication, such as plural and non-plural versions or misspellings.
For that reason, I typically prefer hierarchical taxonomies—but it’s a decision that should be made on a case-by-case basis.
For Cooking Methods, I think a hierarchical structure makes the most sense, so we’ll toggle this on. However, if this were an ‘Ingredients’ taxonomy, the parent/child relationship wouldn’t be necessary, and you might opt for a flat structure instead.
Before we save our taxonomy, there is a toggle for advanced options, which is out of the scope for this tutorial, but gives you the ability to customize your taxonomy further with things like a description, default terms, permissions, and more.
Let’s go ahead and hit save, and if we did everything right, we’ll be able to use our new taxonomy in our posts right away.
If you hover over posts, you can see the Cooking Methods taxonomy has been added to the menu, and we can click into it to start adding our terms.
I’ll go ahead and add Grilling and Baking from this screen:
You can also add new terms on the fly from any post as well. So, we’ll jump into this Mac and Cheese recipe and add our Stove Top term directly from the post.
Both methods of adding terms do the same thing, so you can just use whatever is most convenient at the moment.
Now that you have your new taxonomy created, you can do things like show it on the front end of your post, create an archive for all the posts within its terms, or set up a filtering system to make it easier for your visitors to find the content they’re interested in.
If you want to add more taxonomies, you just repeat that same process.
Custom Taxonomies: Advanced Uses
By this point, I hope you’re starting to see beyond categories and tags, and you’re brainstorming ways you can use custom taxonomies to better organize your website’s content.
But taxonomies can be used for even more functionality…
I often create a “Layouts” taxonomy that has terms like “narrow width” (that reduces the content width for things like my privacy policy page) or “No Footer” (that removes the footer from a post with the click of a button).
If you want to get really sophisticated, taxonomies can be used to assist with access control, personalization, injecting dynamic content (like calls to action or ads), and even re-theming posts on an individual basis.
The sky’s your oyster!
Taxonomy Best Practices
Before we wrap up, I just want to leave you with a few best practices and tips I’ve learned over the years:
- Plan ahead. You’ll end up with much better structure and organization if you plan out your taxonomies and terms ahead of time instead of adding them only on the fly.
- Keep it simple. There are some excellent reasons to create a custom taxonomy, but don’t go down the slippery slope thinking just because you can, you should.
- Use Descriptive Names. Naming things is hard, but having to decode what something means is a giant waste of time. Clear, not clever!
- Avoid Overlap. This goes back to planning ahead, but be conscious about avoiding taxonomies that overlap. You don’t want two separate drawers for the same thing.
- Be Consistent. Stick to a consistent naming convention and structure across your site to make managing taxonomies easier (especially when you come back in 6 months!)
Example Custom Taxonomy Uses
Here are a few more examples to help illustrate how custom taxonomies can be applied across different scenarios, especially where multiple custom taxonomies could be beneficial:
1. E-commerce Store:
- Custom Post Type: Products
- Custom Taxonomies:
- Product Categories (Hierarchical): Parent terms could be “Clothing,” “Electronics,” “Home Goods,” etc., with child terms like “Men’s,” “Women’s,” or “Kitchen Appliances.”
- Brand (Non-hierarchical): Tags for different brands like “Nike,” “Apple,” “Samsung.”
- Material (Non-hierarchical): Tags such as “Cotton,” “Leather,” “Stainless Steel.”
- Size (Non-hierarchical): Tags like “Small,” “Medium,” “Large.”
- Benefit: Helps customers filter and find products by multiple attributes, improving the shopping experience and increasing sales.
2. Educational Platform:
- Custom Post Type: Courses
- Custom Taxonomies:
- Subject (Hierarchical): “Science,” “Math,” “History” with subcategories like “Physics,” “Algebra,” “World History.”
- Level (Non-hierarchical): “Beginner,” “Intermediate,” “Advanced.”
- Instructor (Non-hierarchical): Names of course instructors.
- Format (Non-hierarchical): “Video,” “Audio,” “PDF.”
- Benefit: Enables students to easily search for courses by subject, level, instructor, or format, enhancing the learning experience.
3. Real Estate Listings:
- Custom Post Type: Properties
- Custom Taxonomies:
- Property Type (Hierarchical): “Residential,” “Commercial” with subcategories like “Apartment,” “Office Space,” “Retail.”
- Location (Hierarchical): “Country,” “State,” “City,” “Neighborhood.”
- Features (Non-hierarchical): “Pool,” “Garage,” “Garden,” “Pet-Friendly.”
- Price Range (Non-hierarchical): “Under $300k,” “$300k-$500k,” “Over $500k.”
- Benefit: Makes it easy for potential buyers to filter properties by type, location, features, and price, improving usability and search effectiveness.
4. Travel Blog:
- Custom Post Type: Travel Guides
- Custom Taxonomies:
- Destination (Hierarchical): “Continent,” “Country,” “City.”
- Travel Style (Non-hierarchical): “Luxury,” “Budget,” “Adventure,” “Family.”
- Activity (Non-hierarchical): “Hiking,” “City Tours,” “Beach,” “Cultural Experiences.”
- Season (Non-hierarchical): “Summer,” “Winter,” “Spring,” “Fall.”
- Benefit: Allows readers to filter guides based on destination, style, activity, or best season to visit, making the content more accessible and personalized.
5. Photography Portfolio:
- Custom Post Type: Photos
- Custom Taxonomies:
- Category (Hierarchical): “Nature,” “Urban,” “Portraits,” with subcategories like “Wildlife,” “Street Photography,” “Headshots.”
- Camera Type (Non-hierarchical): “DSLR,” “Mirrorless,” “Drone.”
- Technique (Non-hierarchical): “Long Exposure,” “Macro,” “Black & White.”
- Location (Hierarchical): “Continent,” “Country,” “City.”
- Benefit: Helps visitors explore photos by style, technique, camera type, and location, creating a more engaging portfolio experience.
6. Event Management Website:
- Custom Post Type: Events
- Custom Taxonomies:
- Event Type (Hierarchical): “Conference,” “Workshop,” “Webinar,” with subcategories like “In-Person,” “Virtual.”
- Industry (Non-hierarchical): “Tech,” “Finance,” “Health,” “Education.”
- Audience (Non-hierarchical): “Professionals,” “Students,” “General Public.”
- Location (Hierarchical): “Country,” “State,” “City.”
- Benefit: Allows users to search events by type, industry, audience, and location, making it easier to find relevant events.
7. Music Streaming Platform:
- Custom Post Type: Songs
- Custom Taxonomies:
- Genre (Hierarchical): “Rock,” “Pop,” “Jazz,” with subcategories like “Alternative Rock,” “Classic Pop.”
- Mood (Non-hierarchical): “Happy,” “Sad,” “Energetic,” “Relaxing.”
- Instrument (Non-hierarchical): “Guitar,” “Piano,” “Violin.”
- Release Year (Non-hierarchical): “2024,” “2023,” “2022.”
- Benefit: Enables users to discover songs by genre, mood, instrument, or release year, enhancing music discovery.
These examples show different ways to use custom taxonomies to improve content organization, usability, and user experience, making it easier for users to find what they need across various types of websites.
Wrapping Up
I hope this tutorial has helped open the doors to the world of taxonomies on WordPress for you and given you the confidence to explore beyond the default categories and tags.
Custom taxonomies are powerful tools that can transform how you organize and display your content. They open up new possibilities for structuring your website in a way that truly suits your needs.
Remember, the key is to plan ahead, keep it simple, and always aim for clarity and consistency in your taxonomy structure. With these best practices in mind, you’re well on your way to creating a more organized and efficient WordPress site.