Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have some aging Wordpress blogs where I made the mistake of creating way too many categories (50+ in some instances). This was, in part, due to the fact that tagging was not yet available in Wordpress.

I'd like now to condense the categories and implement tags. The problem is, I don't want to break indexed links.

What strategy and perhaps plug-ins could I consider to do this? Ideally, the category listing pages would permanently re-direct to the appropriate tags, which I would set. I've also got to deal with the problem of people who pull feeds directly from categories.

Should I just chalk these few sites up to a learning experience and leave them alone, or is there a way for me to make this correction so late in the game?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Under your site's Tools > Import menu there is a plugin you can install called Categories and Tags Converter, which once installed will give you control over how to handle categories you might want to convert.

This is a relatively painless process in the 3 times I've used it, but I never concerned myself with migrating older urls. If that's a concern, and the "slugs" for category are the same, and you're running under Apache, some .htaccess directives for the individual categories should do the trick. So, assuming you have urls like:

http://example.com/archive/category/foo
http://example.com/archive/category/bar

And want to change them to:

http://example.com/archive/tag/foo
http://example.com/archive/tag/bar

You would add directives for each one in your .htaccess file, like so:

Redirect permanent /archive/category/bar http://example.com/archive/tag/bar
Redirect permanent /archive/category/foo http://example.com/archive/tag/foo

Now, that presumes that you want them redirected, and none of your blog authors are going to be adding those categories back!

But generally, this would be the approach that would work.

If you're at all concerned with losing data when you alter content, BACK UP YOUR MYSQL DATABASE. Sorry, I had to yell that. :-) And if it goes haywire then simply restore your database.

If you have linked to those old urls in your content, they'll redirect fine. But you could also run WordPress Search and Replace plugin, which facilitates a migration like that, but again, mind backups especially with the Search and Replace plugin, since it makes its changes with no backup.

share|improve this answer
    
Outstanding and comprehensive answer, and I appreciate yelling where backups are concerned! :) What eludes me is how I missed that plugin. –  Tim Post Jul 13 '10 at 17:55

WordPress offers an option to convert selected tags to categories, and vise versa. I think it's been done in a way to ensure that no links are broken - redirects are put in place as needed.

share|improve this answer
    
I may just be snow blind, but did not see such an option? –  Tim Post Jul 13 '10 at 2:58
    
Log into your WP admin, and click into the categories view, listed under Posts. There should be a link leading to the category/tag converter. –  Grant Palin Jul 13 '10 at 4:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.