For beginners: What is WordPress Taxonomy?

SkyStra
May 7, 2020

Taxonomy plays an integral role in grouping relevant content on your website together, which allows your readers to find groups of materials that better suit their interests.

For example, if you have a fashion blog you could create taxonomies for different categories like a male, female, summer, winter, collections, and so on and then assign relevant articles to each taxonomy. This method saves time for your visitors, as it allows them to access content that they are interested in without scouring through other materials that are of no relevance to them.

Types of WordPress Taxonomies

Two types of taxonomies are available on WordPress – categories and tags.

These can be seen on the right side of both Classic and Gutenberg WordPress editor:

There are two ways to add taxonomies to your WordPress website:

  • Directly from the WordPress editor (as shown above)
  • By hovering over the Posts option located on the sidebar of your WordPress Dashboard where Tags and Categories are

The difference between Categories and Tags

From the image above, it’s clear that the interface for adding tags is different from that of adding categories.

This means that tags are optional, while categories are not since each post has to be assigned to a category. Categories are also hierarchical, which means that you can add subcategories under the main category, which can’t be done with tags.                                                                                                                                                

Usage of categories and tags will depend on what you need to accomplish on your website. 

Categories are designed to group your content in a broader sense, and often sites have less than ten categories.

Tags, on the other hand, can be used only in a particular post, and sites usually have thousands of tags across all the posts.

An example to illustrate the difference between categories and tags is the fashion site that we mentioned earlier:

Let’s assume that you are writing a product review on women’s shoes – the category will be (Women’s Shoes). At the same time, the tags would be “brown,” “leather,” “classic,” and so on (very specific and narrowed to the item).

Note: Every post must have at least one category assigned.

WordPress allows you to assign multiple categories to a post. However, if you are doing this, you should only choose categories that are relevant to the post, or else it could be confusing to your readers and you’d have a lot of organizing to do down the line.

Displaying Taxonomies on your website

WordPress allows you to display categories and tags on your website easily using WordPress widgets.

Head to Appearance > Widgets, and drag either or both Categories and Tag Cloud widgets to the desired location:

Use custom Taxonomies for better categorization

WordPress supports two taxonomies out of the box, but it also allows you to use custom taxonomies and expand the functionality of your website.

Custom taxonomies can be structured as either tags or categories (remember that categories are hierarchical, while tags are not).

For example, if you have a fashion blog, you can add custom taxonomies to be Gender or Designer, which makes it easy for your visitors to find the relevant content.

How to create custom Taxonomies

There are two ways to create a custom taxonomy using WordPress:

  • Using a plugin
  • Manually, via custom code

Many plugins can help you create custom taxonomies, and the most popular are:

These plugins are regularly updated, well supported, and easy to use, so we recommend them.

To create custom taxonomies manually using code, you will need to use the register_taxonomy() function. You can learn more about this function at the official WordPress Codex page.