wp_spam_comment: mark a comment as spam
Moves a comment to the spam status.
Arguments
| Argument | Required | Meaning |
|---|---|---|
comment_id |
Yes | The comment |
dry_run |
No | Report without writing |
Permissions
Allow content writes open, and moderate_comments.
Use this for spam, not trash
The distinction matters and is easy to get wrong.
Spam tells WordPress and any anti-spam service that this was spam. That feedback is how filters improve — marking spam correctly makes the next batch smaller.
Trash just removes it. No signal, no learning.
An assistant clearing a queue with wp_trash_comment disposes of spam without teaching anything, and the queue refills at the same rate next week. Reach for this tool when the content is actually spam.
Conversely, do not mark a genuine but unwanted comment as spam. Training a filter on real messages from real people makes it worse, and on some services it can affect that author elsewhere.
It is reversible
Spam is a status, not a deletion. A comment marked as spam can be recovered from Comments → Spam in the WordPress admin until the spam queue is emptied.
That makes it the safe default for anything you are confident is spam, and it means a mistake is correctable.
Marking by ID
Mark comments 4420 and 4421 as spam.
For an obviously spammy queue you may reasonably want to act in bulk, but the IDs should still come from a list you read:
List the pending comments, group them, and give me the IDs you think are spam. Do not mark anything.
Then mark the ones you agree with. The assistant is good at spotting the pattern and has no stake in being wrong.
What it returns
The comment ID and its new status.
The dry run
Reports the comment ID and the action without applying it. It does not return the comment content — read the comment first if you are unsure what you are marking.
When the queue is mostly spam
That is a filter problem. These tools act on the queue; they do not configure anti-spam.
Marking spam correctly helps over time, but a queue arriving faster than you can triage needs a spam service, comment settings changes, or comments closed on old posts — none of which is exposed over MCP. See What POM AI MCP does not expose.
After marking
- The comment disappears from the site immediately.
- Purge the cache if comment counts are displayed.
- The spam queue accumulates; emptying it is a WordPress admin task.
Common problems
| Symptom | Cause |
|---|---|
| The write is refused | Content write gate closed |
pom_ai_mcp_forbidden |
No moderate_comments |
| A genuine comment was marked | A criterion was delegated; recover it from the spam queue |
| The comment count is unchanged on the site | Cache not purged |
| Spam keeps arriving | This tool moderates; it does not filter |
Related
wp_trash_comment— for unwanted but genuine commentswp_get_pending_comments- Review and moderate comments