Skip to main content
Glama

Moderate a comment

wp_moderate_comment
Destructive

Set one WordPress comment's moderation status to approve, hold, spam, or trash to moderate replies and handle unwanted discussion.

Instructions

Set the moderation status of one comment: approve marks it approved, hold sets it back to pending, spam marks it as spam, trash moves it to the trash. Returns {moderated: true, comment_id, status}, status being the one asked for: the answer does not confirm that WordPress stored it, and wp_get_comment shows the stored status. Needs moderate_comments and the right to edit this comment (edit_comment), which follows the right to edit its post. Approving shows the comment wherever the post's comments are public, and WordPress may notify the post's author. Where the site's trash is off (EMPTY_TRASH_DAYS 0), trash deletes the comment for good, as in WordPress; every other change can be reversed by a later call. Trashing a top-level note (comment_type note) also trashes its reply notes, and setting the note to approve or hold later does not bring those back. An unknown comment_id returns a not-found error. Deleting outright is done by wp_delete_comment.

Input Schema

NameRequiredDescriptionDefault
statusYesNew status: approve, hold (pending), spam or trash. Other values are refused.
comment_idYesId of the comment, as wp_list_comments returns it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses the return shape, caveat that the response does not confirm storage, required capabilities, public visibility and author notification effects, reversibility, EMPTY_TRASH_DAYS behavior, note-reply trashing behavior, and not-found errors. These are substantial behavioral details for a destructive mutation tool.

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?

The core action and return shape are front-loaded, and the remaining sentences carry important caveats about permissions, public effects, trash irreversibility, and note descendants. It is dense and somewhat long, but most of the detail earns its place for a destructive tool.

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 destructive moderation tool with no output schema, the description covers side effects, permissions, reversibility, edge cases, error behavior, and alternatives. An agent has enough information to invoke it correctly and understand the consequences.

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 enum and comment_id are already documented. The description still adds useful semantics: what approve, hold, spam, and trash do, that hold means pending, and that an unknown comment_id returns not-found.

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: setting the moderation status of one comment, and enumerates the four supported statuses. It also distinguishes the tool from wp_delete_comment by saying outright deletion is handled there.

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

Usage Guidelines5/5

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

It explains the effect of each status, names wp_get_comment for checking stored status, and routes outright deletion to wp_delete_comment. It also warns when approving makes the comment public and when trashing becomes permanent, which directly guides use.

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