DEV Community

Cover image for WordPress Concepts: Taxonomies and Categorizing Posts
Amirition
Amirition

Posted on

WordPress Concepts: Taxonomies and Categorizing Posts

In the previous posts, I wrote about custom post types and action/filters in WordPress. Another great concept that can help you in understanding and developing WordPress themes and plugins is taxonomies.
So basically a taxonomy is something that you classify, categorize or group WordPress post types with. How about an example?
Suppose that you have a website with a custom post type, Movie!
anything about a movie that you can categorize your movies with can be a taxonomy. For example genre, country, award, rate and etc.
Alt Text

As you can see in the above picture, the IMDB uses taxonomies too. For genre taxonomy, horror is a "term" in WordPress. So every taxonomy has some terms in it. Horror, drama, comedy, sci-fi, and western are some terms for genre taxonomy.

WordPress has two default taxonomies which we're all familiar with:

  • Tags Which are non-hierarchical built-in taxonomies.
  • Categories Which are hierarchical built-in taxonomies.

You can create your own taxonomy and create an archive page for them. Find out how to create a taxonomy for CPT in WordPress developer reference.

How did you use taxonomies in your project? Are tags and categories enough for any project? Tell me in the comments.

Discussion (0)