Do you want to convert your WordPress categories into custom taxonomies? Categories are one of two default taxonomies that help you sort your contents. However, WordPress also allows you to create and use custom taxonomies. In this tutorial, we'll show you how to easily convert WordPress categories into custom taxonomies.

how-to-convert-categories-to-custom-taxonomies.png

Why and when should you convert categories into custom taxonomies?

Categories and Tags are the two default taxonomies on WordPress. Taxonomies are used to sort and organize the contents in different subjects.

In addition to the default taxonomies, WordPress also allows you to create custom taxonomies that you can use with existing post types or with custom post types.

As your grow Website, you might need to convert your categories to a custom taxonomy. For example, let's say you have a category called "Topics" with lots of subcategories. It would be cumbersome to edit each post and file it under your new custom taxonomy.

Would not it be nice if you could bulk convert all or some of your categories to the new custom taxonomy?

Let's take a look at how you can easily convert categories to custom taxonomies without manually editing each post.

Converting WordPress Categories to Custom Taxonomies

The first thing to do is to install and activate the plugin Taxonomy Switcher. For more details, see our step-by-step guide to way to install a WordPress plugin .

After activating the plugin, you need to visit the page Tools »Taxonomy selector on your WordPress dashboard to convert categories into custom taxonomies.

to switch categories on WordPress.png

On this page you can select the taxonomies you want to convert. For this tutorial, we'll select "Categories" as the taxonomy we want to jump from, and " Themes: as the custom taxonomy we want to change to.

taxonomy switcher plugin WordPress.png

If you want to convert all categories to a custom taxonomy, you can click on the 'Change taxonomies' button.

The plugin will convert all categories to your selected custom taxonomy. You will see a success message like this:

success message taxonomy switcher.png

If you just want to convert specific categories, you'll need to add the identifiers of those categories next du champ "Comma separated list of term ids to switch« .

switch categories using identifiers.png

Also, if you want to ignore child categories of a specific category, you can add the parent category IDs and check the “Limit taxonomy switch to child terms of a specific parent” option.

Don't forget to click on the “Switch Taxonomies” button to save your changes.

Configuring Category Referrals to Custom Taxonomy

After you switch categories to a custom taxonomy, the category archive page now displays a 404 error page. There is nothing to worry about if your Website is not online yet.

However, if your Website is live, search engines may have already crawled pages in your category and indexed them. This means that these pages may appear in search results and users coming from search engines will see a 404 error page.

To resolve this problem, you must redirect users to the new taxonomy page for each category.

Fortunately, there is an easy solution for this.

First you will need to install and activate the plugin Redirection. For more details, see our step-by-step guide to way to install a WordPress plugin .

When activating, you must visit the page Tools »Redirection . In the Source URL field, you must enter /category/.* and in the Target URL field, you need to enter your custom taxonomy slug, for example / Topic / $ 1

configure redirections.png

Next, you need to check the “Regex” box and click on the “Add redirect” button.

This redirection will now send all the Category archive traffic to your custom taxonomy. Only use this if you don't want to use categories at all.

We hope this article has helped you learn how to convert WordPress categories to custom taxonomies. If you have any questions, please share them.