Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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. :) –  toscho May 6 '12 at 23:14

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.

share|improve this answer

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.