Skip to content
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.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
dm-clone-taxonomy.php

README.md

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.

Usage

wp clonetax <source_taxonomy_name> <target_taxonomy_name> [--post_type=<post_type_name>] [--skip_meta_keys=<key1,key2>]

Notes

Need to empty out your target taxonomy when testing?

wp term delete target_taxonomy_name $(wp term list target_taxonomy_name --format=ids)

Supports the --debug switch to give more detailed information.

Todo

  • 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.

You can’t perform that action at this time.