As you learned in the first part of this series, post types provide a big-picture macro-level for breaking up the content into logical groups. That gets content like media, menus, posts, and pages into different buckets. Next, we need a way to provide contextual information about the content and give readers additional mechanisms to explore and discover content. WordPress provides us with taxonomies.
This article is Part 2 of the Developer’s Guide to Differentiating WordPress Content. Subsequent articles are coming your way. And I’ll pull it all together into an e-book for you too that will include a guide to help you decide when to use each and when to build a custom experience. I’ll throw in some best practices and plenty of examples for you too. It’s time for you to master these classification mechanisms once and for all.
Taxonomies and Terms – Micro Grouping and Context
The post types provide big bucket grouping for content. Taxonomies provide the micro-classifications to relate like-content to each other.
Let’s start with some definitions.
Per Wikipedia, a general taxonomy is:
the practice and science of classification of things or concepts, including the principles that underlie such classification
WordPress defines a taxonomy as:
A taxonomy is a way to group things together.
Both definitions are saying the same thing. Taxonomies are a grouping mechanism. We group by a set of characteristics. In this context, “characteristics” applies to the content itself.
Imagine a blog with hundreds, maybe thousands of posts. Topics can be wide-spread. Taxonomies allow us to present discovery opportunities and tailor the content to what the reader wants to read.
The Power of Taxonomy and its Terms
Filtering content is a huge benefit of this level of classification. But let’s go further.
For us, we can build amazing interfaces and web pages based upon each level of classification. A jazz page might look stylistically different from a rock or classical page. We are tailoring the experience for the reader based upon the classification.
For the business owner, terms give information about their readers. We can track viewing habits to see their interests and then present offerings specifically tailored to that market segment. Think about that. If you have a giveaway that’s 2 tickets to a rock concert, you’d want to focus in on readers who are interested in that genre. If you are selling a product that fits a specific pain point for a certain group, you can target the message and offering based upon the reader’s viewing habits.
That’s the power of taxonomies and terms: finding relevant content and delivering the right information to the right market segment.
Category – Taxonomy
A category is a built-in taxonomy that comes out-of-the-box with every WordPress website.
What is a category?
I like this definition:
a class or division of people or things regarded as having particular shared characteristics
Essentially then a category is a way of grouping like content by a shared characteristic.
Let’s give you a practical example to help you wrap your mind around a taxonomy and its terms.
Let’s say your blog is about music. You’ll likely write about bands, festivals, artists, and review albums. There are a lot of different types of music (genres). One reader may really dig jazz (hmm, me) and want to read all of the content about that genre. Another might want to read about their favorite band, discover the festivals they’ll be at, news about them, and upcoming albums.
You can use the built-in category (taxonomy) to specify the specific groupings, such as genre, band, festival, etc. These then are individual categories (terms). Genre is a term. Band is a term. Festival is a term. Each of these, when used within the Category taxonomy, are specific categories.
Tags – Taxonomy
WordPress provides us with another built-in taxonomy called “tag.” You’ll notice when you look at the built-in interface that tags are not hierarchical. Hmmm, why is that?
If a category has levels to it and tags don’t, that tells us then that tags are more specific characteristics. They are meant to be one specific characteristic. That’s why they are not hierarchical. Categories, however, can have different tiers (levels) of characteristics.
Let’s go back to our music blog example.
Your blog may have category terms such as genre, bands, festivals, and more. Notice in the categories that a festival could be genre-specific. Right? It could be a rock festival. And bands are typically grouped by genre as well.
Therefore, we might use tags as a way to say this article is about Acid Jazz (my favorite) and Incognito (yup, you guessed it, my favorite band). These more specific classifications relate to the article and to the categories as well.
Think about from a viewer’s perspective. Someone comes to your blog. They like R&B. They want all of the content that is R&B specific. Providing that “term” gives them a way to find what they are looking for while discovering more of the content on your website. Win. Win.
Aha, then tags can also bound to more than one category. Did you notice that? They are a single specific characteristic.
“Custom” – Taxonomy
Out-of-box WordPress provides us with different pre-defined taxonomies, which we discussed above. Each one has a specific intent and role for its content. But not everything fits within these pre-defined groupings. There are times when you need to build a new grouping for your project.
The term “custom” means that it is not built into WordPress Core’s codebase. It means you’re extending WordPress by adding a new taxonomy, one that you define and configure.
A custom taxonomy then seeks to provide a new grouping classification that doesn’t fit within Category or Tag. It’s different than how you are using categories and tags. It just doesn’t fit. Therefore, you need to provide a custom one for your project.
Let’s go back to our music blog again. Now our website is a music store. The owner sells tickets and different memorabilia, as well as writes about music.
The site owner wants a way to profile bands. You decide to build a custom post type called “bands.”
For a specific band, at this point, you have to ask yourself if the categories fit this new content. Hmm, let’s think about that. The categories are genre (yes, that fits), festivals (maybe), and bands (nope).
The best fit is the genre. That one spans blog posts, bands, tickets, swag, gear, and memorabilia. Therefore, it’s a good candidate to break out as a separate taxonomy.
Let’s do another example. You’re building a website for a real estate developer. They build homes, subdivisions, condos, etc. Got that in your mind?
Their blog is all about home trends, financing, build status, cool new features, etc. But how about specific home models? That doesn’t fit into the blog. So you build a custom post type called “home-model.”
Some candidates for classifying a home model might be location, i.e. which subdivision or development project does this home model belong to.
If I’m in the market to buy a home, I know the area where I want to live. I need a way to find all of the home models available from this builder for that specific area.
In this use case, you would build a custom taxonomy called “location.” Its terms are the different property locations.
When – a Practical Example
Let me help you to relate the taxonomies. We’ll use Know the Code.
I group content on this site by skills, technologies, and catalogs.
Skills are used as the main characteristic for the Mastering Libraries, i.e. WordPress, PHP, jQuery, Workflow, Clean Coding, Computer Science, etc.
Technologies are used for Docx. What technology or programming language is attached to the documentation. They can be different from skills, as I wouldn’t write a construct explanation for “cleaning coding.”
Catalog terms are specific keywords that you would search for when looking for things like architecture, action hooks, filter hooks, taxonomy, terms, template, data type, etc. All of the content on the website can then be gathered up and categorized for the Catalog.
And then categories are for blog posts. They may include a skill, technology, or some catalog term. However, they also include things like give-aways, news, tips, etc.
Do you see how I’ve used taxonomies to provide more contextual classifications to promote grouping and discovery?
Look around this website and you’ll discover how you can further differentiate content for your clients and their audience.
How to Build a “Custom” Taxonomy
Building a new custom taxonomy is easy as it’s only a few lines of code. The Custom Taxonomy Basics lab will walk you through the basics of how to add a new one.
Wrap it Up
Do you better understand the intent and role of taxonomies now? From a technical point of view, we have to think about their role based upon how we build, filter, and render content. For a business point of view, we think about how to maximize the impact of the website and make the content work for us. For a reader, they don’t care about these technical terms, but they do care about the experience.
What do you think? Does it make sense to you? Let me know in the comments below.
Did you learn something new? Share your thoughts.