Anyone who has maintained a WPMU site lately has more than likely had to contend with spammers worming their way in to create user accounts. Have you noticed that the function to ban email domains in WordPress MU 2.8.4 doesn’t work? You enter the domain in the options for banned email field and they still seem to get through! My biggest offenders lately are from the mail.ru domain. Wicked weasels! Here’s a way to tie their tails together and set them on fire! Much thanks to D’arcy Norman and his helpful post for this very simple fix:
1. Find this file: wp-includes/wpmu-functions.php
2. Locate this function: is_email_address_unsafe() around row 880
3. Turn the string into an array! (see below)
Before:

After:
function is_email_address_unsafe( $user_email ) {
$banned_names_text = get_site_option( "banned_email_domains" ); // grab the string first
$banned_names = explode("\n", $banned_names_text); // convert the raw text string to an array with an item per line
if ( is_array( $banned_names ) && empty( $banned_names ) == false ) {
$email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );
foreach( (array) $banned_names as $banned_domain ) {
if( $banned_domain == '' )
continue;
if (
strstr( $email_domain, $banned_domain ) ||
(
strstr( $banned_domain, '/' ) &&
preg_match( $banned_domain, $email_domain )
)
)
return true;
}
}
return false;
}
This is a simple fix in the first two lines of the function, but oh so necessary! I’ve tested it on one of my installs and it works. If you’re maintaining a WPMU site and you’re tired of having to delete fake users, implement this quick fix.
If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more
Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more
Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more
It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more
Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more
To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more
Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more
No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more
If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more
Pingback: Your Free blog platform » Blog Archive » Quick Fix to Ban Spam User Accounts on WPMU
This fix was included in the mu 2.8.5.x release.
Excellent. That’s good news.
This was fixed in 2.8.5. but it still doesn’t solve the problem!
Pretty cool post! Some great information to be absorbed in this post. I really like the tips you have given.It’s a very interesting post.Thanks for sharing.Keep posting.
Excellent post!!Thanks a bunch for sharing such useful post with excellent tips with us.. Keep blogging.