WordPress CMS modifications
Making WordPress the ultimate CMS!

Oct/07

5

Protect your site from spammers with the Bad Behavior plugin

Protecting your WordPress blog or website from spammers should be a number one priority for any site administrator. It can be quite bewildering how to do this – as your site get’s more popular the spam starts building up – and that’s no fun for anyone! This plugin takes a different approach to this hot issue.

The best way to protect your site from spam is a combination approach, as there is not one plugin or method that will catch everything. I will be writing about various other plugins that should be deployed in future posts, but to start of with – lets look at Bad Behavior by Michael Hampton.

After installing Bad Behavior on a fairly busy site (Google PR6, 600+ unique visitors a day), the spam comments not caught by my other measures have been reduced to around 5% of what they where, less than 10 a month so far! Also the ones quarantined by the other anti-spam measures have been vastly reduced, which means less time spent checking over these for false positives!

Quote from the authors website

‘Bad Behavior complements other link spam solutions by acting as a gatekeeper, preventing spammers from ever delivering their junk, and in many cases, from ever reading your site in the first place. This keeps your site’s load down, makes your site logs cleaner, and can help prevent denial of service conditions caused by spammers.’ You can read more about the features and benefits here.

WordPress installation

  1. Download the latest file
  2. Unzip file, ensuring file paths are preserved
  3. Upload decompressed folder named Bad-Behavior to wp-content/plugins/
    NOTE: You may strip out all the files in the root folder, leaving just:- bad-behavior-wordpress.php- Folder bad-behavior
  4. Login and activate the plugin
  5. Once activated it has an options page under the Options tab

WordPress template tags

No template tags are needed – if you want to display the number of attempts that the plugin has blocked, you simply have to tick the option in the admin page.

This will work as long as the template you are using has the wp_footer template tag – have a look in footer.php to see. It shows the number of blocked attempts in the last 7 days.

Plugin code modification

- Change the footer function to just show in admin panel not front-end of website

Search for the line:

add_action('wp_footer', 'bb2_insert_stats');

Change to:

add_action('admin_footer', 'bb2_insert_stats');

No comments yet.

Leave a Reply

<<

>>