• Home
  • About
  • Contact
  • Contribute or Donate
  • Privacy Policy
James Pegram dot com
The random musings and incoherent, mindless drivel of an internet junkie!!

registration login

WPMU Block Spam By Math

JamesJanuary 4, 2010 19 Comments

If you run a WordPress MU installation then you’re more than aware of the growing problem with spambots out there creating blogs to simple load links back to their spam sites. New WPMU installations can expect to be found and attacked within a few days of going live and if you have an open registration process, well, be ready to spend a lot of time weeding out the spam blogs.

My WPMU site Stampin Corner started getting hit the day it went live and I’d see between 5 an 15 new spam blogs created every day. After searching around and trying several solutions intended to stop the bots, and getting frustrated none of them really worked, I decided to just modify an existing plugin that I use on my regular WordPress installations.

It’s called WPMU Block Spam By Math. It’s based on the simple, yet highly effective plugin Block-Spam-By-Math created by Alexander Grau. Where Alexanders plugin protects your blogs registration, login and comment forms from spambots, WPMU Block Spam By Math protects your new blog creation process and the new user creation process.

It’s a simple plugin really but I find it to be highly effective at what it does. By simply adding math question to workflow (something like “what is 5+2 ?”). I won’t say it’s 100% effective but after adding this plugin to Stampin Corner two weeks ago, I’ve not had a single spam blog created (knock on wood).

Installation is simple:

  1. NOTE: As of version 1.2 of this plugin you must have Buddypress 1.2.3 installed. For prior versions of BP you will need an older version of the plugin.
  2. Download the plugin from WordPress.org.
  3. Copy it to the wp-content/mu-plugins directory of your blog.

That’s all there is to it. You should now start seeing a dramatic reduction in the amount of spam blogs you see created. NOTE: This does not protect against those spammer who take the time to manually create spam blogs on your site. For those I recommend barbed wire and toothpicks under the fingernails.

BuddyPress Users
If you are using BuddyPress this plugin should still work fine unless you are using the default BuddyPress theme. If you want this plugin to work with the ‘bp-default’ theme you need to make a manual edit to create a new hook location. The process is very simple.

For versions of BP prior to 1.2.2

Open your wp-content/themes/bp-sn-parent/registration/register.php file.

Locate this line of code (approx. line 215).

<?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>

BELOW this add this line of code:

<?php do_action( 'bp_before_current_signup_step' ) ?>

For versions of BP 1.2.2 and newer (tested on 1.2.3)

  1. Simply install/upgrade the plugin

I completely skipped 1.2.2 but since it was reported the plugin wasn’t working correctly on that version I’m going to assume the problem was the same. If you are on 1.2.2 and still have problems upgrade to at least 1.2.3.

It appears BP is now able to bundle their default theme within the plugin directory and in doing so added a new hook which I had to manually add in previous versions. This update applies to an unaltered install of BP 1.2.3, if you have the older BP default theme in your wp-content/themes directory you should be able to delete it then activate the new default theme which resides in wp-content/plugins/buddypress/bp-themes/bp-default. (NOTE: This plugin will no longer work properly using the older default theme if you’ve upgraded BuddyPress).

There are NO manual edits for this version of BP just be sure you have downloaded and installed version 1.2 of the WPMU-Block-Spam-By-Math plugin. It should as simple as auto updating Buddypress and updating WPMU-Block-Spam-By-Math to the latest version (download from Codex or use link above) then switching your theme to the new Buddypress default theme.

FAQ

  • Does this plugin work with the regular Block spam By Math plugin?
    Yes, you can run both. I use the regular WordPress plugin on my WPMU site as well to allow individual site owners the option to add the protection at the blog level.
  • Does this plugin work on regular WordPress?
    No. This is only targeting the WPMU new blog signup and new user signup functions. If you need WP registration, login and comment protection I recommend you get the Block Spam By Math plugin.
  • Change I change the math questions?
    Yes, just edit the two rand functions in the plugin file to generate whatever type of numbers you want.
  • Does this plugin work with BuddyPress?
    Yes. See the Buddypress note above under installation. You have to perform a manual edit in order for it to work with the default Buddypress theme.

Support
If you like this plugin and want to support me, leave a comment or check out my donations and support page!

Wordpress alexander grau, barbed wire, block spam, comment forms, dramatic reduction, fingernails, knock on wood, math question, open registration, plugin work, registration login, spambots, spammer, toothpicks, weeding, Wordpress, wordpress mu

Recent Comments

  • James on SSL/HTTPS with Zend Framework
  • Douglas on Block Spam By Math Reloaded
  • zendnewb on SSL/HTTPS with Zend Framework
  • Jen on Block Spam By Math Reloaded
  • Sam on SSL/HTTPS with Zend Framework

Recent Posts

  • How to Handle Post Revisions in WordPress
  • You got to hate the LAG!
  • SSL/HTTPS with Zend Framework
  • The Ultimate A-Z Index of Apple OS X/Linux command line commands
  • Schedule Random Post Time
  • Twitter
  • Facebook
  • RSS
  • Email
  • YouTube

Tags

amp atmosphere backdrop biter blip tv block spam blog blogs buddypress business types christmas default theme different animal gals gift card google jazz vocalist laszlo life love lutz macdonald maine lobster tails marko merry christmas new template north carolina pear photo credit plugins plugin work pricey side prime rib salt lake city snowfall spam spambots splurge stampin up demonstrators vb4 Wordpress wordpress mu xbox xbox-360 x photo
© 2019 James Pegram dot com. All rights reserved.
Flato by ThemeMeme