Content Validation: Require At Least 2 Keywords Including Either test1 or test2 in New Topics

Hi team,

I’m looking for a way to enforce a content rule for topic creation in a specific category. The rule is:

When creating a new topic, the post must contain at least two keywords, and either test1 or test2 must be included among them.

I’ve explored the built-in category settings and templates, but they only allow guidance — not actual enforcement. I’m wondering:

  • Is there a way to implement this rule using existing features (like tags, category settings, or Discourse Automation)?

  • Or would this require a custom plugin or theme component?

  • Has anyone built something similar?

Any suggestions or best practices for enforcing this kind of validation would be appreciated.

Thanks in advance!

Hello @S.AAKASH_MUTHIAH welcome to Discourse Meta! :waving_hand:

The only thing that comes to mind at the moment are category form templates. These allow you to create a template for a category and you can require validation to make a field required. However, like the name suggests, it looks like a form so if you want a topic that people can type freely and include one of two keywords it might not be the best solution. Perhaps someone else can chip in :slight_smile:


:pencil: Edit: This is what ask Discourse AI said when I asked just now.

Requiring Specific Words in Discourse Topics AI

ondrej:

Is there a way to ensure a user includes a word in a topic before they are allowed to post it?

DiscourseHelper:

Searching

Searching for: How can an admin require that topics include a specific word in their title or body before being allowed to be posted, using core settings, plugins, or customizations, and is there a built-in feature, or workaround, such as automation, to enforce this restriction on new topics?

Reading

Read: Content Validation: Require At Least 2 Keywords Including Either test1 or test2 in New Topics

There is no built-in core feature in Discourse to strictly require that a user includes a specific word in a topic’s title or body before allowing them to post it.

Here are the options currently available:

  • The closest native option is to use “category form templates,” which can include required fields (forcing users to input certain information before posting). However, these work as structured forms and are not ideal for enforcing inclusion of a specific word or keyword in a free-typed topic. Users can still modify or remove the template, so strict validation of a specific word in the body or title is not natively enforced.
  • There is not, as of now, a setting, plugin, or automation in the official Discourse lineup that enforces the inclusion of a specific word in the topic title or body.
  • If strict enforcement (blocking post unless a specific word is used) is required, a custom plugin or theme component would be needed.

For more details and a related community discussion, see:

If this is an important requirement for your site, you may want to consider commissioning a plugin or contacting Discourse support if you’re on a Business or Enterprise plan.

Let me know if you want more details about form templates or advice on custom options!