I really dislike spambot posts. You know, the ones that advertise jumbled links. There are quite a few plugins to combat blog comment spam, and they usually come in two varieties: one that filters and identifies spam posts and another that forces users to identify a random word displayed as an image in order to block spambots that cannot read your image. You can use both varieties of spam filters in tandem. There’s even a third option where you can rename your comment and trackback files in order to reduce the server load from spambots.

At any rate, I’ve developed my own anti-spam image plugin. You can test it by leaving a comment on this site.

My plugin is based on Anti-Spam Image by Krazy Nio (which I can no longer locate) and I also used some code that I learned from what I like to call the best PHP tutorial ever.

Features

Toggle whether registered users need to enter the word

Random font display

No cookies required

No JavaScript required

Auto-generated audio for visually impaired users

Easy-to-read

No mapping of words from the code — words are used once or removed after 24 hours

Reminder of what was entered if you get the word wrong

Selective blocking of trackbacks, pingbacks

Easy to translate

Negatives

Purposely no obscuring techniques so that the anti-spam word is easy to read

The more people who use this plugin, the more motivation for spambots to target it

Requirements

GD Library and FreeType Library (There’s a diagnostic page at Manage > Custom Anti-Spam in your WordPress admin panel to tell you whether you have them installed. If needed, just ask your web host to install them!)

Instructions:
2.0+ releases:
Unzip the entire folder custom-anti-spam to your plugins directory, so that the path is wp-content/plugins/custom-anti-spam/. Then activate the plugin via your WordPress admin section. The plugin should work directly “out of the box”, but all settings can be customized in the Settings > Custom anti-spam page in your WordPress control panel (3.1.0 and up) or in the plugin file itself (3.0.7 and lower). If you are upgrading from a previous release, de-activate that release first.

– Keep the words short (7-8 letters max).
– Make sure you upload the .ttf files in binary, not ASCII format.
– After initializing the plugin, log out of WordPress to test it. By default registered users don’t have to enter the anti-spam word (although this can be changed in the settings at the top of the plugin file).
– If you have a funky theme, you might want to tweak the code to display optimally. For example, with the In Business theme, try copying and pasting the default comments.php code over In Business’s comments.php; for the Blix theme, check this out.
– Check the diagnostic page at Settings > Custom Anti-Spam in your WordPress admin panel to see any possible problems.
– Getting a database error after installing? You might have to create the tables manually. See this forum post for details.
– Are you using WordPress 2.6 or higher and did you move wp-config.php or the wp-content folder to a non-default location? Upgrade to version 3.0.7 of the plugin or higher and configure the $cas_wpconfig setting in the plugin file itself.
– If you are using a caching plugin that does not allow specific parts of a page to be uncached, set the option “Use JavaScript to generate anti-spam code” to “Yes”.

Plugin upkeep

For best continuing anti-spam performance:

– Change up the anti-spam words every once in a while
– Change up the fonts every once in a while

————————

Please make all comments and questions regarding the plugin in the forum! The number of comments were getting to be a bit hard to follow, so the forum should help with organization. Old comments are on the history page.

Note: you can still test the plugin using the comment form on this page. However, all comments are deleted once daily.

Contact Me

Comment on any of my posts to contact me. Your e-mail address will only be visible to me and not to the public. If you want to contact me in a more private manner, e-mail peterkeung.biz. Hire my web consulting services at Mugo Web.