Skip to content

Instantly share code, notes, and snippets.

@petenelson
Last active July 8, 2022 14:04
Show Gist options
  • Save petenelson/1c7158837fac36bd361cf759e20f891e to your computer and use it in GitHub Desktop.
Save petenelson/1c7158837fac36bd361cf759e20f891e to your computer and use it in GitHub Desktop.
WordPress: CLI command to add a new term to posts based on an existing term
wp post list --taxonomy_name=existing-term-slug --format=ids | xargs -0 -d ' ' -I % wp post term add % taxonomy_name new-term-slug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment