• Can someone please provide an example of a regular expression added to the WordPress “Diallowed Comment Keys” textarea?

    The official documentation on “Comment moderation” informs the reader that WordPress’ built-in “Disallowed Comment Keys” textarea (disallowed_keys) supports regular expressions:

    * https://wordpress.org/documentation/article/comment-moderation/

    The second option is to specify a set of moderation keys which, if present in any part of the comment, will cause it to be held for moderation. These keys are specified one per line in the large text area, which is blank by default. Moderation keys can include Spam Words, swear words, IP addresses, and Regular Expressions.

    Unfortunately, it doesn’t provide any examples. And, oddly, googling only provides some articles where folks write their own plugins with hooks to pre_approved_comment — none use this built-in regex functionality.

    An example is important because there’s many kinds of regular expression formats. Sometimes they need to be encased in forward slashes (/). It’s really unclear how to use it without an example.

    Can someone please provide an example of how to use regular expressions in the WordPress “Diallowed Comment Keys” textarea?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.