WordPress comment and metadata tool reference
Ten tools covering two unrelated things that share a chapter: comment moderation, and post custom fields.
Comment tools
| Tool | Does | Write |
|---|---|---|
wp_get_comments |
List comments | |
wp_get_pending_comments |
List the moderation queue | |
wp_approve_comment |
Approve one | Yes |
wp_spam_comment |
Mark as spam | Yes |
wp_trash_comment |
Move to trash | Yes |
wp_delete_comment |
Delete permanently | Yes |
wp_create_comment |
Create a comment | Yes |
Post meta tools
| Tool | Does | Write |
|---|---|---|
wp_get_post_meta |
Read post meta | |
wp_update_post_meta |
Write post meta | Yes |
wp_delete_post_meta |
Delete post meta | Yes |
Permissions
Every comment tool — including reading — requires moderate_comments. There is no unauthenticated view of comments, not even approved ones.
Every meta tool requires edit_post on the specific post. Reading a post's custom fields is treated as editing that post, which is stricter than reading the post itself.
All writes additionally need Allow content writes open. Scopes throughout are mcp:read and wp:content:read, plus the write pair for the writes.
The four moderation actions are not equivalent
| Action | Reversible | Feeds the spam filter |
|---|---|---|
| Approve | Yes | No |
| Spam | Yes | Yes |
| Trash | Yes | No |
| Delete | No | No |
Use spam for spam, so the filter learns. Use trash for everything else you want gone. Reserve delete for content that must not remain on the server.
Comments are written by real people
An assistant deciding what to publish or remove is making an editorial judgement on your behalf, on text somebody wrote to you.
The productive division is the assistant grouping and summarising, and you deciding. Name comment IDs rather than delegating a criterion. See Review and moderate comments.
Comments can also contain personal data — a phone number, an address, order details. Reading them transmits that to the connected client.
Post meta is plugin-owned territory
Meta keys belong to whichever plugin or theme created them. Nothing in these tools validates that a key exists, that a value has the right shape, or that anything expects what you write.
The failures are not errors. They are a page that renders oddly, a field that stops appearing, or a setting that reverts to a default — discovered later and hard to attribute.
If you cannot say which plugin owns a key and what format it expects, do not write to it.
Secret-like keys are refused
Meta keys whose names match a credential pattern — containing secret, password, credential, salt, auth key, nonce key, license key, api key, auth token, private key, session token, refresh token, access token or recovery key — are refused with pom_ai_mcp_meta_denied, for reads as well as writes.
The guard is on the key name, so it is a pattern match rather than a guarantee about contents.
No undo for meta
Post meta has no revision history. An overwritten or deleted value is gone unless you recorded it, or restore a backup.
Read before writing, every time:
Show me the current value of that key, then change it.
Related
- Review and moderate comments
- Content tools
- Taxonomy tools for term meta