WordPress – How to Remove Duplicate Categories and Tags

Sometimes you have thousands of duplicate categories or tags. This might happen when you import posts or events, or it can happen naturally when authors create posts and forgot to select existing categories or tags and end up creating duplicates.

As you can see here, we have several categories called “Coding”. They’re duplicate, and we need to delete the duplicates and keep one of them.

wordpress-remove-duplicate-categories-tags

The problem is that by removing a duplicate category or tag, we’ll leave all posts belonging to it without taxonomies. That, in turn, will mean that we will have to open all the posts or pages one by one to assign them a new category or tag, which will take a lot of time.

The solution is to combine or merge the categories in seconds. So the duplicates are removed and all the posts will continue using the “good category” at the end.

We will use the Taxonomy Terms Spreadsheet. This plugin creates spreadsheets for your taxonomy terms in WordPress. It will create a table for post categories, a table for product categories, a table for post tags, a table for product colors, a table for product sizes, etc.

Here are some things you can do with this plugin:

  • Advanced searches by keyword or parent keyword,
  • Edit specific categories or tags and edit them all at once,
  • Edit any field for hundreds of taxonomy terms at once,
  • Export all terms to Excel or Google Sheets,
  • Import terms and changes from Excel or Google Sheets,
  • And many more things.

Before executing the “Remove Duplicates” feature:

To avoid showing 404 errors to your users after removing duplicates, you need to create 301 redirections to the remaining taxonomies. But we can create them automatically for you. Just do this:

  1. Install the Redirection plugin to create the redirection links.
  2. Install the WP Sheet Editor – Redirection extension.

Once both the plugin and the extension are installed on your website, you can run the “Remove Duplicates” feature freely because our plugin will automatically create the 301 redirections to the remaining taxonomies.

A backup is recommended to avoid any problems.


Once you install the plugin, you need to follow these simple steps to remove the duplicate categories and tags.

1- Open the categories or the tags spreadsheet

The plugin creates a spreadsheet for each taxonomy and you need to select which spreadsheet you’ll use.

You can see which taxonomy spreadsheets are available for you by going to WP Sheet Editor > Edit categories, tags, attributes, taxonomies.

  • Open the categories spreadsheet: Click on “Edit Categories”
  • Open the tags spreadsheet: Click on “Edit tags”

wordpress-remove-duplicate-categories-tags

We’ll open the Categories Spreadsheet to use it as an example. You can apply the same steps to the Tags Spreadsheet to remove all the duplicate tags.

Once you open the Categories Spreadsheet, you’ll see all the categories displayed as rows, and all their fields displayed as columns. You can see the duplicate categories in the spreadsheet.

wordpress-remove-duplicate-categories-tags

2- Open the “Merge Terms” tool

You need to open the Merge Terms tool with one click on the toolbar.

wordpress-remove-duplicate-categories-tags

3- Merge all the duplicate categories or tags automatically

The “Merge Terms” tool in the categories spreadsheet has an option called “Merge all the duplicates with same name and hierarchy”.

wordpress-remove-duplicate-categories-tags

Once you select and execute it, this option will find and merge all the terms with same name and same parent.

For example, it processes the terms like this:

  • Phones (not a duplicate)
  • Device > Phones (not a duplicate)
  • Device > Phones (duplicate)
  • Phones (duplicate)

In this case, it will delete all the duplicate categories to leave just one of them.

wordpress-remove-duplicate-categories-tags

As you see, after executing the “Merge all duplicates with same name and hierarchy” option, the spreadsheet shows only one category, and all the posts have been assigned to it.

Done!

Removing hundreds of duplicate categories or tags without leaving our posts or pages without taxonomies is really simple with the Taxonomy Terms Spreadsheet plugin. You don’t have to open them one by one, but you can delete them all at once automatically.

Do you need help?

You can receive instant help in the live chat during business hours, or you can contact us and we will help you via email.

Close