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.
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.
You can download the plugin here:
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”
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.
2- Open the “Merge Terms” tool
You need to open the Merge Terms tool with one click on the toolbar.
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”.
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.
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.
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.
You can download the plugin here: