Duplicate category slug, WordPress

by ~ July 31st, 2010. Filed under: Wordpress.


I was trying to set up a new blog for someone and couldn’t get the WordPress category slug to be the usual default. Instead it changed to “category-2”. This was a problem because I wanted the permalinks to go by category first, so having the link be “category-2” was messy. Trying to manually correct the label didn’t work.

This implied that I already had a “category” category which might have been possible since the blog was originally begun on wordpress.com and I exported the history and imported it into the new blog. I checked and couldn’t find one, but maybe I had already deleted it so I went into cpanel to look. I found the wp_links table in phpmyadmin but still couldn’t correct it. Then I found the problem.

In the wp_links table it listed both categories and tags. There was a pre-existing tag for “category” as well as a matching slug. Ah ha! I went back to the blog, found all the posts with that tag, deleted the tags, then went back to cpanel and was able to change the category slug.

So, moral of the story, WordPress puts both categories and tags into the same table. If you run into duplicates, it adds a dash and a number to the slug. If you want to reset the slug count, you might need to check the tags as well.

Be Sociable, Share!

Leave a Reply