WordPress Questions and Answers (CMA) - User Moderation - Bad Words Filter


Filter Content With Inappropriate Words

Back to User Guides

To adjust bad words filter settings in the WordPress Questions and Answers, navigate to the Admin Dashboard → CM Answers Pro → Settings → Thread tab, then expand the Bad words section.

Navigation to the plugin settings - Questions and Answers Plugin
Navigation to the plugin settings

The admin can filter questions, answers, and comments that contain inappropriate language - for example, some offensive words.

The admin can either add a list of pre-defined words which are not acceptable on the forum, or the content can be automatically checked by AI.

Let's separately consider the following:

  1. Basic settings with a list of pre-defined words.
  2. Settings for AI checking.
Bad words filter settings - WordPress Question and Answer Plugin
Bad words filter settings

Basic Settings

Basic settings - WordPress Forum Plugin
Basic settings
  • Enable bad words filter - If enabled, the question, answer or comment which includes a bad word won't be accepted.
  • Bad words list - Separate each bad word by new line. You can also use regular expressions (compatible with preg_match() in PHP) by wrapping the expression by slashes, for example: /(bad )?words?/.

Front-end Example

Below is a frontend example of the forbidden word in the answer, and the reaction to it.

Example of the answer with offensive word - Questions and Answers Forum Plugin
Example of the answer with offensive word

Instead of posting the answer, the user will see a message explaining why their answer was not posted (the message can be customized in the plugin labels settings).

Blocking the answer with offensive word - WordPress Questions and Answers
Blocking the answer with offensive word

Settings for Checking for Inappropriate Language Using AI

Note: settings in this section were introduced in version 5.0.0.

AI settings for bad words check - WordPress Discussion Forum
AI settings for bad words check
  • Enable bad words filtering by AI - Choose Yes to turn on the AI bad words filtering feature.
  • Which AI should be used to filter bad words - You can choose which AI service to use for filtering: ChatGPT or Gemini.

Important: you first need to configure the basic settings of the chosen AI service - enable it, add the API key and choose the model. Otherwise, AI filtering will not work. Learn more:

  • Prompt for AI to detect bad words - This is a prompt that will be sent to the AI service. We recommend to keep the default prompt, but you can customize it according to your needs. The prompt must contain the shortcode [content] in order to pass the content of the question/answer/comment to AI for checking. The part of the prompt "Answer true or false only" also must be kept, as the plugin algorithm blocks the content if it receives the answer "true".
  • Bad words filtering action - You can choose what to do with the content that contains inaproppriate language:
    • Delete content
    • Move to trash
  • Enable email notifications for AI-detected bad-words rejections - Enable this option if you want to notify the author of the content if their question/answer/comment was rejected.
  • Email subject for the AI-detected bad-words notification - Customize the email subject template.
  • Email template for the AI-detected bad-words notification - Customize the email body template. Both email subject and email body templates accept the following shortcodes for adding dynamic content:
    • [blogname] - name of the site.
    • [type] - type of the rejected content: question or answer.
    • [question_title] - the title of the question or the question that the answer belongs to.
    • [content] - rejected content.
    • [fragment] - first 100 characters of the rejected content.
    • [date] - date posted.

Important: Posting Content With AI Filter

Even if you don't enable manual moderation for questions and answers/comments, when AI filtering is enabled, they are not posted immediately. AI checking can take some time, which may result in a longer loading time and a poor user experience.

To avoid this, when a user posts a question, answer, or comment, they will see a message that the content is being held for moderation. After the AI check is complete, the content is either published on the forum or, if it was removed or moved to trash, the author will receive an email notification.


More information about the WordPress Questions and Answers plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.