What is Taxonomy in WordPress?

Last Updated:May 27, 2021

In real world, taxonomy is the classification of something

Understand Taxonomy in WordPress

Taxonomy in WordPress Context

In WordPress, taxonomy is a way of grouping posts (or custom post) based on a relationship. In default WordPress, you have the taxonomy category and tags which are groups of the posts based on relationship.

You can create taxonomy called recipe, book etc

Default Taxonomy in WordPress

There are two types of taxonomy in WordPress default installation

They are:

1 Category

2 Tags

How to create a taxonomy

You can use two methods to create taxonomy in WordPress.

  1. Use WordPress Plugin
  2. Use manual method [add code to the function.php ]

You have a function called register_taxonomies() in WP codex to create new taxonomies

register_taxonomy( string $taxonomy, array|string $object_type, array|string $args = array() )

You have got several parameters for this function, the first one is the name of the taxonomy.

Add the following piece of code to your function.php file in your theme and you can see the new taxonomy appear under the post menu of the admin section.