Error: Some times when you try to add a category in wordpress it adds -2 in slug of the category and when you try to rename it says ” The slug “category-name” is already in use by another term “
It is not something serious what happens is that the slug is already there in database but if you can not find it in the category then it can be a page, tag or post link. So i always recommend my team that first create all the category the customers want so they do not have to face this issue later.
The solution for this error is very simple and you can do it in two ways.
1. Solution from WordPress Panel:
First make sure that there is no category with the slug you are trying to use. If that is fine check pages and posts but if that is fine then
Go to tags and 99% of time i received complain from my customers this issue was caused because of the tags.
Go to Posts => Tags search and delete the tag which is similar to the slug you are trying to add or rename. After deleting create or rename the slug it will work this time.
2. Solution from Phpmyadmin:
This becomes handy when you are unable to find the duplicate slug in wordpress panel. So log in to your Cpanel and then phpMyAdmin. In phpMyAdmin select the database of your site.
In Database click wp-terms . Then Search.
On search page at slug option choose the second command LIKE%…% and enter the category slug you are looking for. Below is the image of how everything will look like and what you have to do.
When you will click go you will see the slug on next page in database just select it and delete it.
Now you will be able to create the desired category in wordpress panel.
I hope this article is helpful to you and if you have any questions please feel free to ask me.