wp_create_comment: create a comment
Adds a comment to a post, through WordPress's normal moderation pipeline.
Arguments
| Argument | Required | Meaning |
|---|---|---|
post_id |
Yes | The post to comment on |
content |
Yes | The comment text |
author |
No | The author name |
author_email |
No | The author email |
dry_run |
No | Report without creating |
Permissions
Allow content writes open, and edit_post on the target post.
Note this is the post capability, not moderate_comments. Creating a comment is treated as an action on the post.
It is attributed to the acting user
The comment is created with the authenticated user's ID attached. It is your account's comment, not an anonymous one, even if you pass a different author name.
That is the important property, and it is what makes the legitimate uses legitimate: this tool is for your site replying, not for manufacturing an audience.
Do not generate social proof
The prohibition worth stating plainly: do not use this to create comments that appear to come from customers.
Generated testimonials, invented questions to make a post look discussed, or fabricated positive feedback are misrepresentations. In many jurisdictions they are also unlawful, and they are trivially damaging to trust when discovered.
The author and author_email arguments exist for restoring or migrating genuine comments, not for inventing people.
This is one of the few flat prohibitions in this documentation. See Review AI output responsibly.
Legitimate uses
- Replying as the site to a customer question, where the reply is genuinely yours.
- Restoring a comment that was deleted in error, using the original author details.
- Migrating comments from another system, where the author details are real.
It goes through moderation
The comment is created via WordPress's normal comment pipeline, so your moderation settings and any anti-spam plugin apply. Depending on those settings the comment may be published immediately or land in the queue.
Do not assume it is live. Read the result back:
Create the reply, then show me the comment's status.
Comments must be open
If comments are closed on the post, or disabled site-wide, creation fails. The tools do not change comment settings — that is a WordPress option, and comment settings are not among the five writable options. See Update an allowed public setting.
The dry run
Reports the post ID only, without creating anything. It does not echo the content, so it confirms the target rather than the text.
Read the content back to yourself before creating — an assistant drafting a reply on your behalf is writing in your site's voice, publicly.
Review the text before it is public
If the assistant drafted the reply, everything in Review generated copy before publishing applies: facts, commitments, prices, and anything that reads as a promise.
A comment from the site account is a public statement by your business.
What it returns
The new comment ID, or an error.
Common problems
| Symptom | Cause |
|---|---|
| The write is refused | Content write gate closed |
pom_ai_mcp_post_not_found |
Wrong post ID, or a non-public post type |
pom_ai_mcp_forbidden |
No edit_post on the target post |
| The comment is not visible | It went to the moderation queue |
| Creation failed | Comments are closed on that post |
| It shows the wrong author | The acting user is attached regardless of the author argument |