Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Convert WordPress Categories to Custom Taxonomies

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to convert your WordPress categories into custom taxonomies?

Categories are one of the two default taxonomies that help you sort your content. WordPress also allows you to create and use custom taxonomies.

In this article, we will show you how to easily convert WordPress categories to custom taxonomies.

Converting WordPress categories to custom taxonomies

Why and When Do You Need to Convert Categories into Custom Taxonomies?

A taxonomy allows you to organize groups of posts and custom post types on your WordPress website. By default, WordPress comes with two pre-made taxonomies: categories and tags.

However, you can also create custom taxonomies with WordPress, which can be used with existing or custom post types.

As your WordPress blog grows, you may need to convert your categories into a custom taxonomy because it can be overwhelming to file and keep track of each post in a category with different subcategories.

Using custom taxonomies for tagging allows for more accurate and detailed classifications and better content organization.

For example, if you have a recipe website, then creating categories for cuisine type, dietary restrictions, and meal type can be a bit confusing.

Preview of categories and subcategories

However, by creating a custom taxonomy for each of these topics, you can make content organization easier.

Custom taxonomies can also help improve your SEO rankings by giving you the flexibility to use more specific and targeted taxonomy terms.

Having said that, let’s take a look at how you can easily convert categories into custom taxonomies.

How to Convert WordPress Categories to Custom Taxonomies

First, you will need to install and activate the Taxonomy Switcher plugin. For more detailed instructions, you may want to see our step-by-step guide on how to install a WordPress plugin.

Upon activation, head over to the Tools » Taxonomy Switcher page from the WordPress admin sidebar to convert categories to custom taxonomies.

Once you are there, you must select the ‘Categories’ option from the ‘Taxonomy to switch from’ dropdown menu.

This means that we will be converting a category into a custom taxonomy.

Choose categories option from the Taxonomy to switch from dropdown menu

Next, select the custom taxonomy that you want the categories to turn into from the ‘Taxonomy to switch to’ dropdown menu.

For example, if you have a category for dietary restrictions and you want to switch to a taxonomy of the same name, then you can select the ‘Dietary Restrictions’ option from the dropdown menu.

If you don’t know how to create a custom taxonomy, then you may want to see our tutorial on how to create a custom taxonomy in WordPress.

Choose your custom taxonomy from the dropdown menu

If you want to convert all the categories on your WordPress site into this specific custom taxonomy, then simply click the ‘Switch Taxonomies’ button.

However, if you just want to convert singular or multiple categories into this taxonomy, then you will need to add the IDs of those categories into the ‘Comma-separated list of term ids to switch’ field.

Add category ID

To find a category ID, you have to visit the Posts » Categories page from the WordPress dashboard and hover your mouse over the category of your choice.

The category edit URL will now appear in a popup box at the bottom left corner of your screen.

From here, you can easily find your category ID, as it is the number that comes after ‘category&tag_ID=’ and before ‘&post_type’ in the URL.

For more instructions, see our tutorial on how to find category IDs in WordPress.

Attain category ID

Once you have found the IDs for categories, head back to the ‘Taxonomy Switcher’ page.

Next, simply add the IDs for all the categories that you want to convert into a specific taxonomy. Keep in mind that if you add more than one category ID, then you will have to separate them using commas.

Type category IDs in the field

Some of the categories in WordPress also have subcategories (child categories).

However, if you want to skip the child categories, then you can type the parent category next to the ‘Limit taxonomy switch for child terms of a specific parent’ option. This way, only the parent category will be switched to a taxonomy.

Finally, click the ‘Switch Taxonomy’ button to convert your WordPress category to a custom taxonomy.

Type parent category

You will now see the taxonomy that you have created along with the default taxonomies in the Posts menu tab in the WordPress sidebar.

Upon clicking on the custom taxonomy, you will be taken to a new page, where you can easily add terms for the taxonomy by typing in a name and slug.

Add a term to the dietary restrictions taxonomy

Once you have done that, just click the ‘Add New’ button at the bottom to create a new taxonomy term.

Now, visit the WordPress block editor by opening up a new or existing post/page.

Here, you will notice that the category you switched to taxonomy is now displayed in the block panel on the right corner of the screen. From here, you can easily add new terms or use existing ones for your WordPress blog post.

Custom taxonomy preview

Bonus: Set Up Redirects From Category to Custom Taxonomy

After you turn one of your categories into a custom taxonomy, the category archive page will now show a 404 error. This is nothing to be worried about if your website is not live yet.

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

To fix this, you need to redirect users to the new taxonomy page for each category.

To do this, you will need to install and activate the All in One SEO for WordPress plugin. For more details, see our beginner’s guide on how to install a WordPress plugin.

All in One SEO

AIOSEO is the best WordPress SEO plugin on the market. It comes with a powerful redirection manager addon that makes it very easy to find broken links and fix them using 301 redirections.

Note: AIOSEO also has a free version. However, you will need the pro plan for this tutorial to unlock the 301 redirection feature.

Upon activation, you must configure AIOSEO for your website. For more detailed instructions, please refer to our guide on how to set up All in One SEO correctly.

Once you have done that, head over to the All in One SEO » Redirects page from the WordPress admin sidebar.

Here, you will see a prompt asking you to activate the redirection manager. Go ahead and click the ‘Activate Redirects’ button.

Activate AIOSEO Redirects

The Redirects page will now be displayed on your screen.

From here, simply add /category/.* into the ‘Source URL’ field.

Once you do that, click the gear icon in the field to open some additional settings for the source URL. From here, check the ‘Regex’ option.

After that, enter your custom taxonomy slug, e.g., /dietary_restrictions/1 into the ‘Target URL’ field.

Add the source and target URL

Next, make sure that ‘301 Moved Permanently’ is chosen as the redirect option from the dropdown menu.

Finally, click the ‘Add Redirect’ button in the right corner.

Choose 301 as the redirect type

Upon creation, the redirect you created will be displayed at the bottom of the page.

From here, you can always toggle the switch to ‘Inactive’ if you want to disable it.

Disable the redirect by toggling the switch

This redirect will now send all your category archive traffic to your custom taxonomy.

However, we recommend using this method only if you don’t want to use categories at all.

If you want to redirect individual categories to a custom taxonomy page, then you may want to see our beginner’s guide on setting up redirects in WordPress.

We hope this article helped you learn how to convert WordPress categories to custom taxonomies. You may also want to see our guide on how to style individual categories differently in WordPress and our expert picks for the best conditional logic plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

1 CommentLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.