· 4 min read
How to Filter Strong Language Out of Text
Manesh Jayawardhana
CIO & Co-founder
You’ve got a transcript going into a client deliverable, or a batch of user comments heading for a public page, and someone needs to check the language. Reading three hundred comments manually is a poor use of an afternoon; running them through a filter and shipping the output unread is a worse idea.
The useful position is in between, and it depends on knowing exactly what a word filter can and can’t do.
What a filter actually does
A profanity filter matches text against a list. That’s the whole mechanism, and everything good and bad about it follows.
It’s reliable for the obvious cases: the standard set of words, spelled normally, in a language the list covers. For a transcript or a comment section where most content is fine and a handful of items aren’t, that’s genuinely useful.
It fails in two directions, and both matter.
False positives come from substring matching. The classic example — a British town whose name contains a rude word — is common enough to have its own name, the Scunthorpe problem. Surnames, place names, and technical terms all get caught, and whole-word matching reduces this without eliminating it.
False negatives come from evasion. Spacing, character substitution, deliberate misspelling — any of these defeat a list, and a determined person will always be one step ahead of one.
Why people get stuck here
- Treating filtering as moderation. A word list has no concept of harassment, threats, or context, which is what moderation is actually about.
- One severity for everything. Masking mild and severe language identically makes ordinary text unreadable.
- No review step. Automated output published unread eventually mangles someone’s surname.
- Sending user content to a third party. Comments you’re responsible for shouldn’t be transmitted to an unknown service to be checked.
What good filtering looks like
Severity tiers
Mild, moderate and severe are different problems. A tool that lets you mask the severe and merely flag the mild produces output people can actually read.
An action you choose
Masking with asterisks, removing the word, or flagging it for review are all valid depending on context. Masking suits published output; flagging suits an editing pass.
False positives surfaced, not hidden
A filter that tells you which matches are likely to be place names or surnames saves the review step from being a full re-read.
| Action | Result | Best For |
|---|---|---|
| Mask | f*** | Published comments |
| Remove | Word deleted | Automated summaries |
| Flag only | Nothing changed | An editing pass |
Common mistakes to avoid
- Enabling maximum sensitivity on text containing place names or surnames, then publishing without reading.
- Using a filter as the entire moderation policy — abuse rarely depends on a listed word.
- Filtering a transcript that will be quoted, where masked words change the meaning of a statement.
- Assuming a list covers every language in your content. Most cover one well and others barely.
- Trusting a filter against deliberate evasion, which it will lose eventually.
How to do it with Profanity Filter
The Profanity Filter processes text in your browser — nothing is transmitted, which matters when the text is user content you’re responsible for.
- Paste the text, comment batch, or transcript.
- Choose a severity threshold. Masking everything makes ordinary writing unreadable.
- Pick the action: mask for published output, flag for an editing pass.
- Read the flagged false positives before accepting the result — place names and surnames are the usual culprits.
Other text processing tools that keep content local are in the tools directory.
Frequently asked questions
Why does it flag ordinary words?
Substring matching finds real words inside innocent ones. Whole-word matching reduces it, but genuine ambiguity remains — some place names and surnames simply contain the strings. Review is part of the process, not a sign the tool is broken.
Can a filter catch deliberate evasion?
Only partly. Spacing, character substitution and invented spellings defeat any list eventually. Treat filtering as a first pass over ordinary content, not as a defence against someone actively trying to get through.
Is my text sent anywhere?
No. Matching happens in your browser. For user-submitted content you’re responsible for, that’s the arrangement you want.
Final thought
Use a filter to find candidates, not to make decisions. The five minutes spent reading its flags is what separates a useful pass from a published apology.