# Actions on Watched Words

**URL:** https://meta.discourse.org/t/actions-on-watched-words/65148
**Category:** Feature
**Tags:** rfc, watched-words
**Created:** [June 26, 2017, 8:50pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148 "2017-06-26T20:50:12Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 26, 2017, 8:50pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/1 "2017-06-26T20:50:13Z")

</div>

**[Read this topic about the completed feature](https://meta.discourse.org/t/automatic-actions-based-on-words-found-in-posts/66878)**

* * *

One of the [features for v1.9](https://meta.discourse.org/t/discourse-version-1-9/61289) is for actions to automatically be taken when posts contain certain words. The goal is to have a better alternative to censoring words.

As a starting point, we need a UI to define and manage this set of words.

Some things to think about:

- There can be many words to add and see, so there need to be ways to bulk add as well as ways to easily add a few words.
- Each item is made up of only two values: the word and the action that will be performed.
- The list can be very long.
- Is it valuable to see the list of words at all, especially if they’re all offensive words? List the words only when requested by the user?

Here’s a rough mash-up of the Settings and Tags UI:

 ![](https://global.discourse-cdn.com/meta/original/3X/f/b/fb9a5f5d7c994aefc02b425ca817a10cd67f5552.jpg)

(Ignore the words list… it’s a screenshot of some of Car Talk’s tags.)

Another consideration: this mock-up makes it look like you can add the same word to all three actions. I don’t think it makes sense to allow all these actions to be taken for one word.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 26, 2017, 9:47pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/2 "2017-06-26T21:47:14Z")

</div>

An alternative is to do like the screened IP addresses list:

 ![](https://global.discourse-cdn.com/meta/original/3X/0/b/0b7a0c85634f2b2eb52319f9b5ab9217ad453015.png)

The table is mostly wasted space since there isn’t much to show, but lends itself well to infinite scrolling in case you’re in the mood to read offensive words.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [June 26, 2017, 10:12pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/3 "2017-06-26T22:12:45Z")

</div>

> [@neil](#):
>
> Each item is made up of only two values: the word and the action that will be performed

Are you sure you can go straight from word to action? I think there needs to be some cumulative score across all words in a post and then actions are triggered based on thresholds.

Without wanting to make things too complicated, that score could possibly be integrated with the existing community flagging system (e.g. a certain score counts as one flag, a higher score counts as two flags etc)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 26, 2017, 10:16pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/4 "2017-06-26T22:16:25Z")

</div>

No plans for score: if the word appears, the action is taken. If the word does not appear, the action is not taken. Additional complications aren’t in scope at this time, but maybe in the future once the new 1.9 feature is in place.

---

<div class="post-metadata">

### Author: ![ked](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ked/32/64837_2.png) [@ked](https://meta.discourse.org/u/ked)
#### Post date: [June 27, 2017, 3:39am UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/5 "2017-06-27T03:39:47Z")

</div>

Has the notion been considered of wanting to watch for “good words” appearing, and and what might want to be done following their appearance?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 27, 2017, 5:03am UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/6 "2017-06-27T05:03:43Z")

</div>

What is your use case for such an unusual feature? Can you provide examples?

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [June 27, 2017, 8:04am UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/7 "2017-06-27T08:04:43Z")

</div>

One example would be replies with the word “thank\*” in them, as in “thanks!” or “thank you”.

IF user replies with “thank\*” and hasn’t Liked the post they’re replying to, show a JITN:

> If you’d like to formally thank this user, like their post!

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [June 27, 2017, 8:09am UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/8 "2017-06-27T08:09:20Z")

</div>

In fact we are already doing it for the narrative bot: [discourse/plugins/discourse-narrative-bot/lib/discourse\_narrative\_bot/track\_selector.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/track_selector.rb#L241)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 27, 2017, 8:16am UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/9 "2017-06-27T08:16:47Z")

</div>

I guess to your point we could “de-negative” this by calling it Action Words @neil, as in

> When you see this word, take this action

I guess that’s a fair criticism.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 27, 2017, 11:58am UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/10 "2017-06-27T11:58:45Z")

</div>

> [@codinghorror](#):
>
> What is your use case for such an unusual feature? Can you provide examples?

This was requested at elastic. People want to be notified whenever a particular product name appears in any post.

---

<div class="post-metadata">

### Author: ![rizka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rizka/32/79717_2.png) [@rizka](https://meta.discourse.org/u/rizka)
#### Post date: [June 27, 2017, 2:34pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/11 "2017-06-27T14:34:27Z")

</div>

I’m very excited about this! Right now, we use a list of censored words to ban linking to some shady news sites which exist to promote online gambling. Then we also use censored patterns to block some swear words and harsh expressions. It’s very useful because we have popular live commentary threads for sports events in which people comment the course of action in real time. Sometimes your fingers are quicker than your mind when you are passionate about your team.

So is the plan to support just words or also **regex patterns**? Regexes would be extremely useful for my native language Finnish and other languages in which words are inflected.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 27, 2017, 10:20pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/12 "2017-06-27T22:20:03Z")

</div>

6 posts were split to a new topic: [Whitelisted words](https://meta.discourse.org/t/whitelisted-words/65236)

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 27, 2017, 4:18pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/13 "2017-06-27T16:18:41Z")

</div>

> [@codinghorror](#):
>
> I guess to your point we could “de-negative” this by calling it Action Words

Yeah I was thinking of simply “Watched Words” or something like that.

> [@sam](#):
>
> This was requested at elastic. People want to be notified whenever a particular product name appears in any post.

This is similar to another request that was being called “keyword alerts”. It’s similar, but is only useful as a per-user setting. The use case is a forum with buyers and sellers, and the sellers want to be notified when a post mentions the product they’re selling.

There’s no end of use cases for “do something when someone posts something”, so let’s prevent this topic from becoming a brainstorming session.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 27, 2017, 10:18pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/19 "2017-06-27T22:18:02Z")

</div>

I think the problem is that my post didn’t explain what this feature is for. I thought “blacklisted words” was self-explanatory, but apparently not!

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 27, 2017, 10:23pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/20 "2017-06-27T22:23:21Z")

</div>

> [@rizka](#):
>
> So is the plan to support just words or also regex patterns? Regexes would be extremely useful for my native language Finnish and other languages in which words are inflected.

Hmm, we should be able to include support for basic regexp patterns like “`funki*`”.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 27, 2017, 10:56pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/21 "2017-06-27T22:56:22Z")

</div>

> [@neil](#):
>
> This is similar to another request that was being called “keyword alerts”. It’s similar, but is only useful as a per-user setting. The use case is a forum with buyers and sellers, and the sellers want to be notified when a post mentions the product they’re selling.

Sort of, I think that could be implemented a completely different way: issue a search periodically (ordered by date, desc) and any new search results cause the user to get notified. eBay does this for example with “saved searches”. I don’t think it needs to be implemented such that every single post is checked for a word at the time of posting by X different users, that feels like massive overkill to me.

We can build a saved search feature or plugin at some later date..

> [@neil](#):
>
> I was thinking of simply “Watched Words” or something like that.

Not bad, some crossover with Watched Categories and Watched Topics so I think I prefer that too, it teaches about the concept of Watching.

> [@sam](#):
>
> People want to be notified whenever a particular product name appears in any post.

We could have a Watched Word action of “notify staff” but that is _literally_ what flags are already for… right now the possible watched word actions should be:

- flag
- block
- require approval
- **censor**

I think you forgot the last one there @neil. I don’t know that I can come up with any other actions that make good sense here?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 28, 2017, 7:50pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/22 "2017-06-28T19:50:01Z")

</div>

Yeah, censor should be in there too. I guess it should replace the existing site settings “censored words” and “censored pattern”.

Also, we should figure out exactly what “block” means. Obviously, the post will not be posted. But should the user be given feedback like “Your post contains a blocked word”. Should the user be blocked?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 28, 2017, 10:35pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/23 "2017-06-28T22:35:30Z")

</div>

Just block the individual posting, is what I was thinking. We may want to be coy about what the block is for, something like “contains words that aren’t allowed”.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [July 26, 2017, 6:41pm UTC](https://meta.discourse.org/t/actions-on-watched-words/65148/24 "2017-07-26T18:41:37Z")

</div>

Continued here:

> [@Automatic Actions based on post content (Watched Words)](https://meta.discourse.org/t/automatic-actions-based-on-words-found-in-posts/66878):
>
> New for 1.9 is the ability to take some actions based on watched words found in a post. Block the post at the time it is submitted. User sees a message saying they’ve used a word that’s not allowed. Flag the post as inappropriate, but allow it to be submitted. Censor the words, which replaces the censored\_words site setting being removed by this feature. Require Approval of the post, hiding it until staff reviews it. add a Link to a word Replace words in posts with other words Tag the post aut…
