Tags to Categories? (14 posts)

  1. Robert Koehler
    Posted 8 years ago #

    I just converted all my categories to tags, but it's now clear that was a mistake? Is there a way to reconvert tags back into categories?

    NOTE: I don't have a backup. Does that mean I'm completely screwed?


  2. MichaelH
    Posted 8 years ago #

    You are probably out of luck.

    Do you have a recent backup (from a week or two or three ago) that you could use to restore, then reenter any new posts since that time?

    Sometimes hosts make backups--check with them.

    WordPress Backups

  3. eikep
    Posted 8 years ago #

    I made the same mistake since I automatically assumed that the tags would be copys of, not replacements for the categories (since this was the way the "converter" of my previous tagging plugin worked, the proper meaning of "convert" is not all that obvious if one isn't a native english speaker). But this seems easy to fix:

    If you have phpMyAdmin (or similiar) installed open the table 'wp_term_taxonomy' and change the value of field 'taxonomy' from "post_tag" to "category". As far as is can tell this is (database-wise) the only difference between tags and categories and anyway it worked for me.

  4. websta
    Posted 8 years ago #

    I also didn't realize the change from categories to tags was so catastrophic and that there was no going back.

    After researching how to do what eikep suggests, I went into mysqladmin, pulling up the database, clicking the SQL tab at the top, and entering:

    UPDATE wp_term_taxonomy SET taxonomy = replace(taxonomy,"post_tag","category");

    I didn't get the response I thought I would (~an error message) but it worked. Thanks, eikep!

  5. missadventures
    Posted 8 years ago #

    Hi there,

    How does this work exactly? I go to the SQL tab of wp_term_taxonomy and it says:

    SELECT * FROM wp_term_taxonomy WHERE 1

    If I enter anything else, there's no "submit" button. So I can't figure out how the UPDATE coding above is supposed to work.

    Let me know.


  6. Sainty
    Posted 8 years ago #

    websta & eikep!
    Thx a lot guys, you saved my life. I almost shot my self when i discovered what I had done when converting those categories hehe

  7. sjhoward
    Posted 8 years ago #

    Thank you, thank you, thank you, and thank you again!
    This thread just saved my life!

  8. bsidemix
    Posted 8 years ago #

    great thread. I did it the same way, and then found the post. http://www.bsidemix.com. Thanks again.

  9. arex
    Posted 8 years ago #

    To add injury to insult, I didn't know WP had destroyed my categories, so I proceeded to rename the new tags and merge them together. OMG. HELP, please!!

  10. andy2boyz
    Posted 8 years ago #

    this was a lifesaver, thanks!!

  11. dtclarinet
    Posted 8 years ago #

    I at first changed all the post_tag to post_category manually (having misunderstood the direction to change to just category). Now when I try to change them to just "category" manually, or use the sql script (changing the request from "post-tag" to "post_category", I get an error message, saying "post_category" not recognized.


    thanks for any help.

  12. dtclarinet
    Posted 8 years ago #

    UPDATE from David- I had to delete the few categories I had created after they all disappeared into tags, then I was able to manually change each of 32 categories back to their original form.

    I hope that little "convenient" "category to tags converter" is revamped or discarded. What a pain.

  13. llworldtour
    Posted 8 years ago #

    Hi all-
    I too want to change my tags back to categories.

    1. Will this copy them or also make my tags now go away?
    2. I went to SQL taxonomy and saw this:
    'SELECT * FROM wp_term_taxonomy WHERE 1'

    and pasted in this underneath it:

    'UPDATE wp_term_taxonomy SET taxonomy = replace(taxonomy,"post_tag","category");'

    I hit "GO" and get an error message with my sql syntax. and it didn't fix the website categories.
    This has obviously helped some of you...if anyone could please walk me through it...I'd greatly appreciate it!!!


  14. murky
    Posted 8 years ago #

    I really want to move to tags totally - but the official converter looks disastrous.

    My expected behaviour for such a plugin

    1) If a category has no corresponding tag, create the tag.
    2) Add the tag to all posts which are in that category.
    3) Optionally, remove the category. Default is 'no'.

    It seems that the official converter has, for point 3, the default of 'yes' - and it's not an option.

    For various reasons, this is undesirable!

    (I'm not even sure if it does 2 - but I haven't tested it as 3. is a showstopper for me).

    Is there a way to create tags based on existing categories (without destroying those categories?)

Topic Closed

This topic has been closed to new replies.

About this Topic