Gotta be careful with things like this. For example (as we recently found out, here), a spam filter that we employ had (past tense) “Cialis” as one of the trigger words to divert email to a spam folder.
It took us MONTHS to realise that any email containing the word “specialist” would trigger the spam filter.
I work at a military installation - “specialist” appears in many emails.
Now, I know that these aren’t “bad” words, but I just threw that out there as an example of good intentions gone awry.
Which is why it would seem to me that writing my own “Bad Word” function would be a better approach.
There isn’t one plug-in on my client’s website and for good reason!
Yet at the same time, why recreate the wheel?
Maybe this question would be better asked in the PHP forum?
If I wrote my own function, I am a little unclear of how you would loop through and check each word in a long post against a database. (This is more complicated than just using a Regular Expression on single word.)
Perhaps… and I will be honest, I don’t know how they normally work. But, it seems to me that you could use a RegEx on the whole input (instead of just one word at a time), and make sure that the “bad” words are properly delimited by space/punctuation (ie, from my example, " cialis ", but RegEx the spaces as \s (whitespace) and/or ::punc:: (punctuation) so that safe words that contain potential bad words within can pass muster… like the word “association”.)