wp_delete_term
Permanently delete a WordPress term and unassign it from all posts. Preview with dry run before applying, as deletion cannot be undone.
Instructions
Delete a term: this PERMANENTLY deletes it and unassigns it from every post.
There is NO TRASH for terms - WordPress requires force on this call and nothing
here can restore it. The posts keep their content but quietly lose that filing, and
the term's archive URL (/category/news/) starts 404ing, which is usually noticed
long after the fact. Check wp_list_terms for the term's post count first, and
prefer re-filing those posts with wp_set_post_terms before deleting. term_id
comes from wp_list_terms. DEFAULTS TO dry_run=true (returns a preview stating that
outcome; deletes nothing). Pass dry_run=false to apply. Requires the REST
transport. Prod writes require allow_prod=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| install | Yes | ||
| term_id | Yes | ||
| taxonomy | Yes | ||
| allow_prod | No |