What is Taxonomy in WordPress?

September 6, 2020

In real world, taxonomy is the classification of something

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

Wordpress Default Taxonomy

How to create taxonomy in WP

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, 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