# Restrict users to post certain words per category

**URL:** https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430
**Category:** Support
**Created:** [February 17, 2023, 4:00am UTC](https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430 "2023-02-17T04:00:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rajput7707](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rajput7707](https://meta.discourse.org/u/rajput7707)
#### Post date: [February 17, 2023, 4:00am UTC](https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430/1 "2023-02-17T04:00:58Z")

</div>

Is there any way to restrict users to post anything containing specified inappropriate words in a specific category only.  
Ex. We have set up two categories A and B. Now we want to restrict the users to post anything containing “xyz” (example). in category A only although users should be able to post anything in Category B…

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 17, 2023, 8:26am UTC](https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430/2 "2023-02-17T08:26:02Z")

</div>

Believe this may be global. You might need to create a plugin to “excuse” certain categories.

> [@Watched Words Reference Guide](https://meta.discourse.org/t/watched-words-reference-guide/241735):
>
> bookmark This is a #reference guide for describing how the Watched Words page functions and the different types of action types you can use to block specific words on a Discourse site. person_raising_hand Required user level: Administrator Understanding Watched Words You can setup Watched Words to take actions based on words found in a topic or post (located at .../admin/customize/watched\_words ). There’s a max of 2000 words per type of action. O…

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [February 17, 2023, 11:13am UTC](https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430/3 "2023-02-17T11:13:04Z")

</div>

Can this official plugin help you?

> [@Discourse Automation](https://meta.discourse.org/t/discourse-automation/195773):
>
> discourse2Summary Discourse Automation lets you automate actions through scripts and triggers. Customisation is made through an automatically generated UI.open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Features Easy automation of complex workflows Triggers automations at specific dates, periodically, or on specific events Provides automatically generated UIs…

**Flag post on Words** : flag a topic on creation/edition if it contains specific words

---

<div class="post-metadata">

### Author: ![rajput7707](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rajput7707](https://meta.discourse.org/u/rajput7707)
#### Post date: [February 20, 2023, 6:07am UTC](https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430/4 "2023-02-20T06:07:56Z")

</div>

Thanks @Lhc_fl , Since i am new to discourse so unable to understand how to create custom plugin or add our feature into any existing plugin. So could you please elaborate on that how exactly i can get my issue resolved.

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [February 21, 2023, 4:40am UTC](https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430/5 "2023-02-21T04:40:41Z")

</div>

Related feature request: [https://meta.discourse.org/t/watched-words-tagging-enable-by-category/255620?u=mattdm](https://meta.discourse.org/t/watched-words-tagging-enable-by-category/255620)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 21, 2023, 1:30pm UTC](https://meta.discourse.org/t/restrict-users-to-post-certain-words-per-category/255430/6 "2023-02-21T13:30:53Z")

</div>

Here’s how to add a plugin to Discourse:

> [@Install plugins on a self-hosted site](https://meta.discourse.org/t/install-plugins-in-discourse/19157):
>
> warning This guide assumes that you have a self-hosted standard installation. We only support the standard method of install here, so these instructions assume you have a [standard install](https://meta.discourse.org/t/142537?silent=true). warning This guide only applies to self-hosted Discourse instances. If you are using a managed hosting service, the available plugins are controlled by your hosting provider. For example, on our hosting [these specific plugins](https://www.discourse.org/plugins) are available by hosting tier. information_source As of mid-2025, [many p…](https://meta.discourse.org/t/373574)

Here’s an example of an automated task with this plugin:

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/8/8/b8869c72299bd8e6028d34a1c53857911a58b83d.png)

It will automatically flag a post that contains some words in a specific category.  
The post’s content will be hidden, but anyone, even regular users, can click a button to show the hidden content.

This can be circumvented with a CSS solution:

> [@The persistence of posts hidden by flags are a bane to our community](https://meta.discourse.org/t/the-persistence-of-posts-hidden-by-flags-are-a-bane-to-our-community/109969/20):
>
> Turns out this does create some side effects: When the most recent post in a topic is hidden and a user clicks on the most recent post indicator in the topics list it will try to go to the hidden post but then “bounce” randomly way back higher in the thread. The owner of the hidden post won’t have a chance to edit it because the controls for the post are also hidden. So this appears to be a better solution: body:not(.staff) { .post-hidden a.expand-hidden { display: none; } …

But note his behavior (hidden message can be read by anyone) is discussed, have a look at:

> [@The persistence of posts hidden by flags are a bane to our community](https://meta.discourse.org/t/the-persistence-of-posts-hidden-by-flags-are-a-bane-to-our-community/109969/23):
>
> How would you feel about having these auto-hidden-due-to-threshold posts hidden to non-moderators and non-flaggers? (leaving it visible as stubs to people who originally flagged and mods) Keep in mind that this is meant to be a temporary state, people can recover from auto hide by correcting a post.
