What is a WordPress taxonomy?
A taxonomy is a way of categorizing content within WordPress. Taxonomies are made up of terms.
What are the types of taxonomies?
WordPress core comes with two taxonomies: categories and tags. Both of these taxonomies are available to be used by WordPress posts. You can add onto the functionality of WordPress by creating custom taxonomies. Custom taxonomies can be used with pages, posts, and/or custom post types.
How are taxonomies used on a WordPress site?
Taxonomies in WordPress are used to organize and view similar pieces of content. On the frontend, taxonomy terms can be viewed as an archive. This is useful to website visitors looking for all content related to a specific topic.
How do I create a custom taxonomy?
As mentioned, WordPress comes with categories and tags which are available to be used by posts. You can also use categories and tags with custom post types if you specify that relationship while creating a custom post type.
There are many instances where you may want to create a custom taxonomy, whether to coincide with a custom post type or otherwise. Following are options for creating a custom taxonomy.
Experienced developers will opt to create a custom taxonomy from scratch. The code for the custom taxonomy can be added to the theme, but it is typically recommended to create custom taxonomies as a plugin. (Creating a plugin instead of adding to a theme will allow the custom taxonomy to remain usable if the theme is changed.)
My preferred way of creating custom taxonomies is using a code generator provided by GenerateWP. The difference between this method and the PHP method described above, is that GenerateWP provides a friendly user interface for creating the custom taxonomy function. Once you have generated the function, you can copy and paste the code to your theme or create a custom plugin (the recommended approach).
If you have limited WordPress development experience you will probably be most comfortable using a plugin to add a custom taxonomy. The most popular plugin for creating custom taxonomies is Custom Post Type UI. This plugin offers an easy to use interface for creating custom taxonomies.
In addition to the plugin used to create truly custom taxonomies, many plugins will create specific custom taxonomies based on their intended use. For example, the Modern Events Calendar plugin creates category and tag taxonomies used only for the custom “Event” post type.
Custom taxonomies can really extend the core WordPress functionality and improve the organizational abilities of all of the WordPress post types. They are added in much the same way as custom post types and are often added in association with custom post types. Custom taxonomies can be added to a theme or as a plugin using PHP or with a user friendly interface courtesy of a custom taxonomy plugin.