Skip to main content
Glama

Delete a comment

wp_delete_comment
Destructive

Delete a WordPress comment, moving it to the trash by default or permanently with force=true; also removes its meta and moves replies up a level when permanently deleted.

Instructions

Delete one comment: into the trash by default, for good with force=true, which also removes its meta and moves its replies up a level. A comment already in the trash or marked as spam, and any comment on a site with the trash turned off, is deleted for good even without force, as in WordPress, so a second call on the same comment deletes it for good. Trashing a top-level note (comment_type note) also trashes its reply notes. A trashed comment can be set to approve or hold again with wp_moderate_comment. Returns {deleted: true, comment_id}; an unknown comment_id returns a not-found error. Needs moderate_comments and the right to edit this comment (edit_comment).

Input Schema

NameRequiredDescriptionDefault
forceNotrue deletes the comment for good instead of moving it to the trash. Default false.
comment_idYesId of the comment to delete.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, it discloses that deletion defaults to trash, force permanently deletes, removes meta, and moves replies up a level. It also explains that already-trashed/spam comments and sites with trash disabled are permanently deleted even without force, making repeat calls non-idempotent. Permissions and return/error behavior are also specified.

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

Conciseness5/5

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

The core behavior is front-loaded: default trash versus force permanent deletion. Despite being dense, every sentence carries useful behavioral, edge-case, permission, or return-value information. There is no redundant restatement of the tool name or schema fields.

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?

There is no output schema, but the description provides the return shape and unknown-comment error behavior. It covers destructive side effects, WordPress-specific trash/spam edge cases, note-reply cascading, permissions, and the alternative moderation tool. This is complete for a destructive delete tool.

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 schema already defines both parameters, including force's default. The description adds meaningful semantics beyond the schema by explaining force's side effects: permanent removal, meta deletion, and reply promotion. It also notes that an unknown comment_id returns a not-found error.

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?

The description states a specific verb and resource: delete one comment. It immediately distinguishes default trash behavior from permanent deletion with force=true, which an agent cannot infer from the name alone. Relevant sibling wp_moderate_comment is also named for the different restore/moderation action.

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?

It clearly explains when to use force versus default trash, including edge cases where a comment is already trashed, spam, or on a site with trash disabled. It also mentions wp_moderate_comment as the alternative for changing a trashed comment's status. It lacks an explicit 'use this instead of X when...' sentence for some sibling operations, but the practical guidance is strong.

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