DM Clone Taxonomy
A WordPress plugin which provides a WP CLI command to clone taxonomy data from one taxonomy to another - copies taxonomy terms, term meta and adds terms to posts of a specified type.
Originally written to enable the creation of a "duplicate" taxonomy to enable a client to re-categorise thousands of e-commerce products on a live site without disruption.
wp clonetax <source_taxonomy_name> <target_taxonomy_name> [--post_type=<post_type_name>] [--skip_meta_keys=<key1,key2>]
Need to empty out your target taxonomy when testing?
wp term delete target_taxonomy_name $(wp term list target_taxonomy_name --format=ids)
--debug switch to give more detailed information.
- Add support for multiple post types.
- Option to store/output $term_map data.
- Should probably make this a WP CLI package.
Built by the team at Delicious Media, a specialist WordPress development agency based in Sheffield, UK.