1

I'm writing a data conversion to merge one custom post type (Faculty) into another (Person).

Merging the actual CPT records is straightforward, but the two post types have similar custom taxonomies that I need to deal with:

  • Faculty has a custom taxonomy, faculty-type, which has both terms and data
  • Person has an empty custom taxonomy, person-type, which has neither terms nor data

I'd like to move the faculty-type taxonomy, including both terms and data, into the empty person-type taxonomy—so that when the Faculty-to-Person conversion finishes, all of the faculty-type data will be present as person-type data for the new Person records.

How can move the taxonomy data from Faculty to Person?

1 Answer 1

2

One simple query will accomplish this Assuming a wp_ table prefix:

UPDATE wp_term_taxonomy SET taxonomy = 'person-type' WHERE taxonomy = 'faculty-type';

Note that if the target taxonomy wasn't empty, additional work would be needed to avoid conflicting terms.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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