Topic on Extension talk:AbuseFilter

Profanity Filter Creation

2
Fokebox (talkcontribs)

I aim to block offensive language for a better user experience. Could someone please guide me on how to create this filter?

Matěj Suchánek (talkcontribs)

First, you will need to decide for yourself whom the filter should concern: all users, new users, anonymous users. Also, which pages it should check. (All pages, topic pages, talk pages, ...)

Then, you will need to decide which text you want to check. Should it be wikitext, edit summary, user name...?

Last, compile a list of profanity words.

For example:

user_editcount < 10 /* users with less than 10 edits */
& ( page_namespace == 0 | page_namespace % 2 == 1 ) /* articles and talk pages */
& contains_any(string(added_lines),
  'word1',
  'word2',
  'word3',
)

Using regex (string(added_lines) rlike 'word1|word[23]') can be more compact if the profane words have many forms.

Reply to "Profanity Filter Creation"