I've created an online game where users can set their own usernames, but I've been facing issues with inappropriate username choices from some players. I'm on the lookout for a free or affordable profanity filter API that can help manage this. If anyone has suggestions or experiences with useful profanity filters, I'd love to hear them!
4 Answers
Are you looking for basic filtering that just checks for bad words, or do you want something more sophisticated? Like filtering short phrases or supporting multiple languages? That could affect the options available!
It's tough to completely filter out profanity! For example, if someone wants to use a name like "Cumberto" which is a play on words, you risk creating false positives that can frustrate users. Plus, you can’t ignore different languages—Spanish swear words could slip through if you're only checking English. Just keep in mind that creative users will find ways around any system, so don’t rely solely on filters.
I see your point; balancing filtering while maintaining user freedom is tricky. But I think some names still need to be blocked, like the truly offensive ones.
I saw a recommendation for a service called Profanity.dev. They have some tools you might find useful for filtering out inappropriate content. Just check it out!
I tried it with some crazy usernames, and unfortunately, it didn’t catch everything. One name passed that definitely shouldn't have!
You have a few choices here. A simple way to filter is just to maintain a list of naughty words and flag any username that contains them. But be aware of the Scunthorpe problem—you might block acceptable words by accident. It could be a good starting point, though!

Good point! I'm leaning toward a basic English profanity filter, but I'm open to recommendations for advanced options too!