Avoiding Problems with WordPress' Category to Tag Converter

Album Cover: The Future

"Love's the only engine of survival."
Leonard Cohen / The Future

Posted on May 11, 2008 7:55 PM in Web Development

After upgrading Browsersphere to WordPress 2.5.1 earlier today, I decided to make the full jump from using categories to tags, since the latter more closely reflect my tendency to associate the post contents with very discrete subjects rather than broader, high-level categories. A fortunate side-effect of this decision is that WordPress' tag support in the new dashboard is much more user-friendly than the category support.

One of the unfortunate side-effects of the decision, though, was that I already had around 100 posts that were associated with categories. Luckily for me, there is an option under Manage -> Categories called the category to tag converter. I immediately gave the feature a try, and at first glance, it did exactly what I expected it to, converting all of my categories to tags and associating all of the posts that were once associated with those categories to the new corresponding tags.

On second glance, though, I noticed that there were several categories that did not get converted. This left me with hundreds of posts that had a handful of tags associated with them and a handful of categories as well. The only consistency I noted was that there were no duplicates between the two lists. That's when it occurred to me that the only categories that had not been converted to tags were those for which I had manually created tags in some of my recent posts.

Not knowing how to proceed, I started manually creating tags that matched the leftover categories for each post. It only took a few before I realized that was going to take me forever, so I started thinking of alternatives. Fortunately for me, I realized that it would be quicker to delete the tags I had manually created in my most recent posts (luckily there were only three posts that were associated with manual tags) and then re-run the category to tag converter.

First, I copied the manual tags associated with the recent posts over into Notepad++ so I was sure I wouldn't lose any of the tags that did not have corresponding preexisting categories. Once I had jotted them down, I went to Manage -> Tags and manually deleted the tags in question. Once the tags were deleted, I re-ran the category to tag converter. Sure enough, all of the remaining categories were converted to tags, and the corresponding posts were associated with the new tags correctly. Finally, I went in and manually added any tags that ended up not having corresponding preexisting categories, and I was finally where I wanted to be.

To summarize, if you find yourself in a similar situation, try to avoid manually creating tags before you run the category to tag converter. Otherwise, all is not lost, but you'll have to decide whether the manual category cleanup or the manual tag cleanup is the lesser of two evils for your situation. Good luck!

Comments

No one has added any comments.

Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.

Name:

Email Address:

Website:

Comments:

Check this box if you hate spam.