Errors if the term doesn’t exist, or there was a problem in deleting it.
- Taxonomy of the term to delete.
- One or more IDs or slugs of terms to delete.
- Explicitly handle the term value as a slug or id.
# Delete post category by id $ wp term delete category 15 Deleted category 15. Success: Deleted 1 of 1 terms. # Delete post category by slug $ wp term delete category apple --by=slug Deleted category 15. Success: Deleted 1 of 1 terms. # Delete all post tags $ wp term list post_tag --field=term_id | xargs wp term delete post_tag Deleted post_tag 159. Deleted post_tag 160. Deleted post_tag 161. Success: Deleted 3 of 3 terms.
GLOBAL PARAMETERS GLOBAL PARAMETERS
These global parameters have the same behavior across all commands and affect how WP-CLI interacts with WordPress.
||Path to the WordPress files.|
||Pretend request came from given URL. In multisite, this argument is how the target site is specified.|
||Perform operation against a remote server over SSH (or a container using scheme of “docker”, “docker-compose”, “vagrant”).|
||Perform operation against a remote WordPress installation over HTTP.|
||Set the WordPress user.|
||Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded.|
||Skip loading all themes, or a comma-separated list of themes.|
||Skip loading all installed packages.|
||Load PHP file before running the command (may be used more than once).|
||Whether to colorize the output.|
||Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help.|
||Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values.|
||Suppress informational messages.|