A simpler way to fight spam on WordPress

Update (2014-04-04) : The plugin is on now in WordPress's registry and on github, feel free to submit any patches.

There are 100s of different plugins that fight spam for WordPress, however almost all of them require user interaction someway or the other, and usually they require a remote service to verify the user's input.

While I was trying to combat spam on this site, I came across Anti-Spam, great concept, however it still required the user's interaction, and then my gears kicked in after analyzing the 1000s of spam comments that were posted on the site I wrote a very simple plugin to combat comment spam.

ChangeLog :

* Redid the auto-deleting logic, it shouldn't leave any traces of the comment in the database anymore.
* Added a comments_array filter so none of the spam comments pass to other plugins.

* Added an option to use an extra check using javascript.
* Added a debug option to embed the score array in comments that passes the plugin.
* Changed the hidden field name, again.

* Fixed a bug with the auto delete option not showing in the user interface.

* Changed the number of possible names of the hidden field.
* Set a higher priority on the preprocess_comment hook.

* Fixed a bug where default settings weren't loaded at all.
* Fixed the wording on the maximum number of urls allowed.
* Added a counter of how many comments have been blocked.

* Rewrote it to use OOP.
* Added configurable options in admin settings.

* First public release.
  • If the comment is a trackback.
  • If the time between loading the page and commenting is less than 10 seconds.
  • If the Session variable specific to this form is not set.
  • If the hidden email field have a different value than "-".
  • If the comment includes more than 3 urls.
  • If the referer isn't set properly.

Works like this :

I have submitted it to WordPress's plugin registry but it's still pending review, so here's the code until it gets accepted :

To install it simply put the file in $WORDPRESS_ROOT/wp_content/plugins , for example :

Then activate it in http://yoursite.com/wp-admin/plugins.php.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTMLtags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">