3

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.

  • I answered my own question. 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. Maybe there's a sexier way to do it, but this worked! – Brent May 6 '12 at 19:49
  • 1
    Please add your solution as a real answer and mark your question as answered. Oh, and add a link to the plugin too. :) – fuxia May 6 '12 at 23:14
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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