Skip to content

Comment Moderation Exp: Add toggle to enable/disable guest comments automatic moderation#751

Open
Intenzi wants to merge 3 commits into
WordPress:developfrom
Intenzi:feat/restrict-comment-moderation-to-logged-users
Open

Comment Moderation Exp: Add toggle to enable/disable guest comments automatic moderation#751
Intenzi wants to merge 3 commits into
WordPress:developfrom
Intenzi:feat/restrict-comment-moderation-to-logged-users

Conversation

@Intenzi

@Intenzi Intenzi commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #750

Adds a checkbox in Comment Moderation Experiment settings.

This allows enabling/disabling of the comment moderation flow (AI sentiment, toxicity analysis) when the comment user is anonymous.

Set to true/Enabled by default.

Why?

This is in continuation to #516 (comment)

It solves the problem of AI analysis being run on unwanted guest users/ spam of guest comments that can cause a Denial Of Wallet attack.

Additionally enables customization to moderation flow for the website's comment moderators.

How?

  • Registers a settings field of the id moderate_guests as a boolean field. Enabled by default.
  • When disabled, skips the AI sentiment, toxicity analysis for anonymous user comments.
  • Copied structure of Content_Classification.php for settings registration.
  • Additionally increased margin top spacing of inline settings form. This is to prevent the checkbox from looking squeezed in with the experiment's description.

Use of AI Tools

AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini 3.5 Flash (Low)
Used for: Identifying the css file for the css fix, adding the integration tests.

Testing Instructions

  1. Enable Comment Moderation Experiment.

a> With Moderate Guest Comments settings field toggled on:

  • Add a comment as a guest user after logging out / on incognito / etc.
  • Go to Comments section in wp-admin and view that the comment has sentiment, toxicity analysis performed on it.

b> Turn off the Automatically moderate guest comments settings field by clicking on it:

  • Add a comment as a guest user after logging out / on incognito / etc.
  • Go to Comments section in wp-admin and observe that the comment does not have sentiment, toxicity analysis performed on it.

Screenshots or screencast

New Automatically moderate guest comments settings field enabled by default:
image

The setting field, toggled off:
image

Comments added when the setting was toggled off, on.
image

Changelog Entry

Added - Automatically moderate guest comments settings field which skips guest comments moderation when disabled.
Changed - Top margin spacing increased in inline settings form.

Open WordPress Playground Preview

Intenzi added 3 commits June 19, 2026 20:29
- ensures the custom setting fields are not too closely bunched to the experiment description
…ion analysis

- checks for analysis skip when toggle is enabled and when disabled
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Intenzi <intenzi@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable guest comments from Comment Moderation AI analysis

1 participant