I have a CPT called adverts and it has 2 taxonomies - category and location. The problem is that there are about 100 entries in location taxonomy and I need to copy the same structure to another CPT - businesses. Doing everything manually will take forever. Are there any solutions for that?

P.S. Taxonomy structure includes parent and children hierarchy P.P.S. I checked the DB structure and due to its design it is hard to find all relations and taxonomies there as they are in various tables. Maybe there some kind of a plugin?

  • Do you want to copy 100 location terms from your original post/page type to the CPT type?
    – AlxVallejo
    Jul 21 '12 at 16:32
  • Nope, I have a CPT "adverts" that has taxonomy "location" consisting of 100 terms. And I need my CPT "businesses" to have the same taxonomy with the same terms Jul 21 '12 at 16:44
  • How are you registering the taxonomies?
    – AlxVallejo
    Jul 21 '12 at 16:59

When you register the taxonomies you can specify multiple post types:

function register_my_taxonomies() {
                  array('post','page', 'adverts', 'businesses'),
  • Heh, that was so easy. I had no idea that the post type can be in array when registering the taxonomy. Life saver! Jul 21 '12 at 17:08
  • My pleasure. Welcome to the site!
    – AlxVallejo
    Jul 21 '12 at 18:51

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.