Removing the number in a category slug

I have a category that ends with -2, and there’s no way I can change it back to the plain word. I know there are problems with numeric slugs, but this is just a word. I also know that a common answer is to look in the trash, but there’s no trash for categories as far as I’m aware

2 Answers
2

You probably have a tag with the same slug. You can’t have any taxonomies with duplicate slugs. Either delete that other taxonomy, rename/change its slug, or change/rename this category.

EDIT

Ok, it turns out you can do this, if you don’t mind programming the fix or directly executing the SQL or messing with PHPMyAdmin. What you need to do is add a new row in wp_term_taxonomy that uses the term with the slug you want to use as the term_id and the new taxonomy (category in this case) as the taxonomy. This is necessary because, if the slug already exists, WP creates a new term rather than using the same term with a different term_taxonomy relationship.

Leave a Comment