The Suggest Reply experiment adds a "Suggest reply" action to the classic Comments admin screen and the Activity widget on the Dashboard. When activated, moderators can generate AI-suggested replies to comments and customize the tone. The ability also automatically applies any site-wide editorial guidelines. The experiment exposes one WordPress Ability (ai/suggest-reply) that can be used from the UI or via REST API.
- Type: Experiment (may change or be removed in any release; try it on a staging site first)
- Runs without a user action: No, only when you ask
- When it runs: When you click Suggest reply
- Sent to your AI provider: Comment text, author name, post title, and excerpt
- Requests and data: One request per click
When enabled, each comment in the Comments list and the Dashboard Activity widget gets an additional Suggest reply action link. Clicking it automatically opens the inline reply editor, generates a context-aware reply, and inserts it into the textarea.
Key Features:
- Adds a "Suggest reply" action to comments in the list table and the Dashboard Activity widget
- Injects in-editor controls for regenerating replies with a different Tone (friendly, professional, casual)
- Uses one shared ability (
ai/suggest-reply) exposed via REST API
The prompt includes the comment, its author, the requested tone, and, for context, the title and excerpt of the post the comment was left on. The post title and excerpt are only included for publicly readable posts. Password-protected posts, non-public statuses (drafts, private posts), and post types that are not publicly viewable are skipped, so gated editorial content is never sent to the provider.
The ai/suggest-reply ability accepts:
array(
'type' => 'object',
'properties' => array(
'comment_id' => array(
'type' => 'integer',
'description' => 'The ID of the comment to generate a reply for.',
),
'tone' => array(
'type' => 'string',
'enum' => array( 'professional', 'friendly', 'casual' ),
'default' => 'friendly',
'description' => 'The tone for the reply.',
),
),
'required' => array( 'comment_id' ),
)The ability returns:
array(
'type' => 'string',
'description' => 'The generated reply suggestion.',
)ai/suggest-replyrequirescurrent_user_can( 'moderate_comments' )
POST /wp-json/wp-abilities/v1/abilities/ai/suggest-reply/run
You can authenticate using either:
- Application Password (Recommended)
- Cookie Authentication with Nonce
See TESTING_REST_API.md for detailed authentication instructions.
curl -X POST "https://yoursite.com/wp-json/wp-abilities/v1/abilities/ai/suggest-reply/run" \
-u "username:application-password" \
-H "Content-Type: application/json" \
-d '{
"input": {
"comment_id": 1,
"tone": "professional"
}
}'Response:
"Thank you for your valuable feedback! We appreciate you taking the time to share your thoughts."The ability may return:
missing_comment_id:comment_idwas not providedcomment_not_found: no comment exists for the given IDinsufficient_capabilities: current user lacks moderation permissionspost_not_found: post of the comment is not found
By default a post's title and excerpt are only sent when the post is publicly readable and not password-protected. Use wpai_suggest_reply_post_context_shareable to widen or narrow that:
add_filter( 'wpai_suggest_reply_post_context_shareable', function ( bool $shareable, WP_Post $post ): bool {
// Allow context from private posts on an intranet site.
return 'private' === $post->post_status ? true : $shareable;
}, 10, 2 );When no context is available a reply is still generated from the comment alone.
-
Enable the experiment:
- Go to
Settings -> AI - Enable global AI features and toggle Suggest Reply
- Ensure valid AI connector credentials are configured
- Go to
-
Suggest reply:
- Go to
Commentsadmin page. - Hover over a comment and click Suggest reply
- Verify that the inline reply form opens, disables temporarily, and populates with the AI-generated reply
- Verify the inline button changes to Regenerate Reply after a successful, non-empty suggestion.
- Use the Tone dropdown to change the tone and Regenerate Reply to request another suggestion. This replaces the current draft, including manual edits.
- Close the reply form or open a reply for another comment and verify the button resets to Suggest Reply.
- Start a suggestion, switch comments, and return before it finishes. Verify the form shows Generating…, accepts its own pending suggestion, and then shows Regenerate Reply.
- Go to
-
REST API:
- Call
POST /wp-json/wp-abilities/v1/abilities/ai/suggest-reply/runwith a validcomment_id - Verify response shape and error handling for invalid IDs or insufficient permissions
- Call
- Requires valid AI credentials and text-generation-capable models
- Requires users with comment moderation capabilities for ability access
- Works on the classic comments list and the Dashboard Activity widget (no block-based comments UI integration here)