Delete a term
wp_delete_termPermanently delete a taxonomy term: its posts lose the term, child terms move to the parent, and its meta is removed. Default terms are protected and return an error.
Instructions
Delete a term from a taxonomy for good; terms have no trash. Posts lose the term (a post left without a category gets the default category), child terms move up to the deleted term's parent, and the term's meta is removed. The taxonomy's default term, such as the default category, is not deleted; it and an unknown term_id return an error. Needs the taxonomy's right to delete terms and the right to delete this term (delete_term), which a site can withhold for single terms. Returns {deleted: true}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term_id | Yes | Id of the term to delete. | |
| taxonomy | Yes | Taxonomy the term belongs to, e.g. "category" or "post_tag". |