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

Related posts

Leave a Reply

2 comments

  1. 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.

  2. Maybe there you used such category name before as subcategory or category and then deleted it. When you created second time category with such name- it got -2.

    I had a similar problem. Just removed a new category with -2 slug, then created category in subcategory directory where I deleted it. Then just changed parent- made it parent category.