Skip to main content
Glama

Delete a term

wp_delete_term
Destructive

Permanently 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

NameRequiredDescriptionDefault
term_idYesId of the term to delete.
taxonomyYesTaxonomy the term belongs to, e.g. "category" or "post_tag".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing exact side effects: posts lose the term and fall back to the default category, child terms reparent to the deleted term's parent, and term meta is removed. It also names the required capabilities and the error conditions, which annotations alone (destructiveHint only) cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the destructive outcome and no-trash caveat, then side effects, then permissions, then return value — a sensible priority order. It is dense but nearly every clause carries distinct information; a slight tightening of the permission sentence would make it ideal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter destructive tool with no output schema, it covers side effects, error cases, permission requirements, and even states the return shape ({deleted: true}). An agent has everything needed to call it safely and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds value by constraining term_id semantically (unknown IDs error) and by explaining that taxonomy must be a real taxonomy whose default term is protected. It doesn't add format details beyond the schema's own examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Delete a term from a taxonomy") with an explicit scope qualifier ("for good; terms have no trash") that separates it from soft-delete siblings like wp_delete_post. An agent can distinguish it from wp_update_term/wp_trash-style operations without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-not conditions: the taxonomy's default term is not deleted and an unknown term_id errors, plus that a site can withhold delete_term for individual terms. It doesn't explicitly reference sibling alternatives (e.g. wp_update_term, wp_list_terms) for reassigning rather than deleting terms, so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools