WP Polite-ifier Plugin for Swearing

What is WP Polite-ifier?
WP Politifier enforces a certain level of politeness in your comments, replacing recognized swear words with acronym’ed asterisks.
Since I also believe in freedom of speech, the original text is preserved in the title attribute, visible on mouseover. However, it solves the immediate problem of keeping my comments and blog “family safe,” at least at first glance. It also has SEO benefits for publishers running Adsense who want to maintain high-quality text without swearing or cursing in it.
The badwords list is editable through the administrative interface, and kept in a text file in the same directory.
Example:

Download:
Please download politeifier.zip from the official Wordpress Extend site, which will always host the latest and greatest version of this plugin. To install, drop badwords.txt and the wp-politeifier.php into your Wordpress plugins directory and activate in the administrative interface.
Update:
Mike Smullin suggested a patch which fixes a bug where the badwords.txt file is unable to be located. This has been fixed.
Tagged with: administrative interface, directory example, wordpress plugins, quality text, first glance, freedom of speech, politeness, mouseover, asterisks, acronym, adsense, publishers, badwords, high quality

February 3rd, 2008 at 1:48 am
THANK YOU! great idea!
February 23rd, 2008 at 6:16 pm
Awesome plugin although i would like to actually not have the option for mouse over is that easy to edit in the original setup ? cause i don’t want a mouse over effect either so yea.
February 27th, 2008 at 12:21 am
Hello, this plugin is really good.
Is there a way to replace a specific bad word for a word I choose?
Maybe adding a little code.
Please help me.
March 11th, 2008 at 1:47 pm
this is a ******* test, you *******
March 11th, 2008 at 1:48 pm
lol sorry about that. figured you were using the plugin on this site. whoops.
March 11th, 2008 at 5:58 pm
It’s ok, that’s why I give you a screenshot
March 31st, 2008 at 3:27 pm
i have your plugin installed and activated, but it isnt working - (see corusa.com and make a comment), it posts the bad comment
April 4th, 2008 at 9:51 am
Testing if the name tag is also edited out
April 9th, 2008 at 2:14 am
This plugin 2.5 compliant?
April 9th, 2008 at 9:49 am
good plugin
April 26th, 2008 at 4:58 am
If you just replace line 30 with the following, it can be put into a directory like any normal plugin instead of cluttering up the plugins folder with files like badwords.txt.
$name = dirname(__FILE__) . "/badwords.txt";You can also replace
str_pad(...)with the clearerstr_repeat("*", strlen($matches[1]))Thanks for this plugin!
April 27th, 2008 at 4:27 am
great plugin
May 5th, 2008 at 8:43 pm
If you don’t want the acronym to show up either, find the line:
return '‘ . str_pad(”", strlen($matches[1]), “*”) . ‘‘;and change it to
return str_pad("", strlen($matches[1]), "*");May 5th, 2008 at 8:44 pm
oops, that first code line (the one to be replaced) should be
return '‘ . str_pad(”", strlen($matches[1]), “*”) . ‘‘;September 20th, 2008 at 1:40 pm
i try the **** plugin
fuc*k? *****? runninginabastardandblablablalool
Okay if it work i install it on my blog!
October 3rd, 2008 at 1:00 pm
(Test)
Hey you idiotic fucktard!
But honestly I don’t think word filtering is the way to go. The problem is what the person is trying to say, not which words they’re using. It’s perfectly possible to insult someone badly without using swearing. I honestly don’t see the problems Americans see with swearing.
If people swear in your blog comments, it’s probably because you wrote something that provoke people to do it. Choose to write about something else, or delete the whole comment. (You’re likely not going to like the rest of it anyway)
Just my two cents.
October 3rd, 2008 at 1:01 pm
Oh, that test didn’t work out too well. Perhaps it would be an idea to filter all words with eg idiot or **** in them? Support for regex patterns perhaps?
October 3rd, 2008 at 10:06 pm
I agree, nitro2k01, but it’s hard to find prefixes / substrings that won’t be bad for other words. For example, ***.
A better approach would use statistical analysis (n-gram markov) to identify swearing “You *** hole” from legit talk “Dangle a carrot in front of an ***.”
October 4th, 2008 at 10:05 pm
Well, it’s overall hard to filter the word *** as a prefix since it appears as a component in many words, like “massive bass assassin”.
But on the other I think it’s fair to assume that any word containing **** is “bad”. This could easily be implemented with a regex looking something like this:
/(^|\W)(\w*****\w*)($|\W)/iI’m actually surprised that the f word slipped through the filter when I added tard to it.