How to convert regular categories to custom taxonomy?

I have a big list of categories/subcategories (around 60 in all). It now makes sense that instead of these categories being available to any post type’s category list, these categories should be moved to my custom taxonomy list that is associated with one specific custom post type. My custom taxonomy (with hierarchical = true) is:

    register_taxonomy( 'drink_cats', 
    array('menu_drinks'),
    array('hierarchical' => true, 

So when I went into wp_term_taxonomy in the db, I thought I could just change the taxonomy value from the default 'category' to my new taxonomy 'drink_cats'. However, doing so breaks the drink_cats list in the admin, and none of my posts are then connected to the taxonomy.

Is there a good way to go about doing this? I’m obviously missing a table I should be going into and updating.

1 Answer
1

Solution pulled out of the comments:

I like to use GWA db Editor to do any quick database updates–so I went into GWA, into the wp_term_taxonomy table.

I changed the Taxonomy column for all my categories to my custom taxonomy (drinks_cats). The key was to also go into the parent column and just change all the values to 0. For whatever reason, this allowed WordPress to move all the categories to my custom taxonomy with no problems.
I then had to reorganize the categories into cats and subcats once there, but it seemed to work doing it this way.

Leave a Comment