Ban Hammer

We’ve all had this problem. A group of spammers from mail.ru are registering to your blog, but you want to keep registration open. How do you kill the spammers without bothering your clientele? While you could edit your functions.php and block the domain, once you get past a few bad eggs, you have to escalate.

Ban Hammer does that for you, preventing unwanted users from registering.

Instead of using its own database table, Ban Hammer pulls from your list of blacklisted emails from the Comment Blacklist feature, native to WordPress. Since emails never equal IP addresses, it simply skips over and ignores them. This means you only have ONE place to update and maintain your blacklist. When a blacklisted user attempts to register, they get a customizable message that they cannot register.

In addition, Ban Hammer has built in support for StopForumSpam.com which can be turned on or off as desired.

Download

Latest version: Download Ban Hammer v1.7 [zip]

Installation

  1. Unpack the zip file and extract the /ban-hammer/ folder and the files.
  2. Using an FTP program, upload the full /ban-hammer/ folder to your WordPress plugins directory (Example: /wp-content/plugins/).
  3. Go to Plugins > Installed and activate the plugin.
  4. Go to Tools > Ban Hammer to customize the error message (and banned emails, but it’s the same list from your comment moderation so…).

FAQ

Q. If I change the blacklist via Ban Hammer, will it change the Comment Blacklist?
A. Yes! They are the exact same list, they use the same fields and they update the same data. The only reason I put it there was I felt having an all-in-one place to get the data would be better.

Q. Does this list the rejected registers?
A. No. Since WordPress doesn’t list rejected comments (your blacklist goes to a blackhole), I didn’t bother with trying to do that here. If enough people think it’s a need, I may consider it.

Q. It breaks when I turn on StopForumSpam checking. Why?
A. At a guess, you don’t have cURL support. You may need to check with your webhost about that. If they do have cURL setup, share the error with me and I’ll try to debug!

Q. Will you add other spam lists?
A. Sure. Or at least I’ll try. I’m not a genius so I may need help with APIs and the right PHP calls.

Q. Does this work on MultiSite?
A. No, and it’s not supported. It won’t even run. No, I have no plans to MultiSite this.

Q. Does this work on BuddyPress?
A. Yes, yes it does. But only single site.

Q. Why doesn’t this work AT ALL on my site!?
A. I’m not sure. I’ve gotten a handful of reports from people where it’s not working, and for the life of me, I’m stumped. So far, it looks like Zend and/or eAccelerator aren’t agreeing with this. If it’s failing, please post on the wp.org forums with your server specs (PHP info, server type, etc) and any plugins you’re running.

Changelog

1.7

  • 24 April, 2012 by Ipstenu
  • Proper uninstallation.

1.6.1

  • 17 April, 2012 by Ipstenu
  • Cleanup. Nothing major here, just documentation and all.

1.6

  • 05 August, 2011 by Ipstenu
  • Internationalization.

1.5.2

  • 09 March, 2011 by Ipstenu
  • Bugfix. Typo made it NOT enableable.

1.5

  • 08 March, 2011 by Ipstenu
  • Allows for deletion of spammers from the User List (credit mario_7)
  • Added optional functionality to show spammer status on the normal users list.
  • Moved Ban Hammer Users to the USERS menu (now called ‘Ban Hammered’)
  • Works on BuddyPress!

1.4

1.3

  • 08 July, 2010 by Ipstenu
  • Pulling out the WPMU stuff that’s never going to happen now that it’s MultiSite and doesn’t work.

1.2

  • 08 November, 2009 by Ipstenu
  • This lists all users marked by StopForumSpam as spammers, if you’re using that option (and not if not). (Thanks to obruchez for the suggestion!).

1.1

  • 03 May, 2009 by Ipstenu
  • Subversion before coffee = BAD.

1.0

  • 03 May, 2009 by Ipstenu
  • First public version.

0.3

  • 30 March, 2009 by Ipstenu
  • The error message is customizable.
  • Added support for StopForumSpam.com
  • Added in checkbox to use StopForumSpam (default to NO).
  • Cleans up after itself on deactivation (deletes the banhammer_foo values from the wp_options table because I HATE when plugins leave themselves).

0.2

  • 29 March, 2009 by Ipstenu
  • Shifted to use the WordPress comment blacklist as source. This was pretty much an 80% re-write from NDE’s basis, keeping only the basic check at registration code.

0.1

  • 28 March, 2009 by Ipstenu
  • First release using No Disposable Email’s .dat file as a source.

Screenshots

  1. ban-hammer screenshot 1

    Default Error message

  2. ban-hammer screenshot 2

    Admin screen

  3. ban-hammer screenshot 3

    Ban Hammer Users

  4. ban-hammer screenshot 4

    Users Menu, with Spammer Flag on

  5. ban-hammer screenshot 5

    BuddyPress Error message

37 Responses

  1. RT Cunningham
    RT Cunningham 16 August, 2010 at 12:33 pm ·

    I don’t have registrations open, but I would love something like this for comments. 99% of my spam comes from web hosts, not real people.

  2. RT Cunningham
    RT Cunningham 16 August, 2010 at 1:27 pm ·

    Since I get a lot of valid traffic from India and Bad Behavior always flags them as false positives, I don’t use that.

    I tried AVH First Defense, but it stopped working for me. I have one multi-site domain but it started having issues before I upgraded to it.

    I tried to write a plugin that would override the comments blacklist settings, making it a true blacklist, but all I ended up getting when I tested it was a white screen of death.

    In my opinion, if I’m running Akismet, the comment blacklist as-is is about useless.

  3. TonyG
    TonyG 16 August, 2010 at 5:12 pm ·

    Almost all of my spam comes from people/bots with the following pattern:
    1) Email domain is “mail15.com”.
    2) The address looks valid, like “johnsmith@…” but the name associated with it is completely different, like “Samantha Moore” for a johnsmith@ address.

    If I can blacklist mail15.com from even registering, I would eliminate virtually all of my blog comment spam.

    I’m also disturbed that WordPress doesn’t simply send me an email for new registrations so that I can spam/trash the registration – before the new user gets to post a spam comment. Right now I’m forced to manually delete the spam and delete the bogus user.

    Can Ban Hammer help with this? am I missing a built-in management function? Any other recommended plugins?

    Thanks!

  4. TonyG
    TonyG 16 August, 2010 at 9:12 pm ·

    WordPress does email me on a new registration. I get that email simultaneously with the email that a comment has been posted to any of my postings. Of course the comments aren’t public. I can spam or trash the comments but this is a manual operation after I go to WP admin. I can then search for and manually delete the offending user. This is all just a waste of my time. I’ll take Ban Hammer for a spin and post back with a comment the next time some event reminds me about it. ;-)

  5. Bruce
    Bruce 23 August, 2010 at 11:56 am ·

    Hey, I just wrote a post here, and got a blank page after the Submit, which usually means a PHP error in the comment plugin you are using.

    But, I’ll try my question again.

    I have a plugin that collects names and e-mails. I’d like to be able to check the e-mails against a black list (which Ban Hammer does for registrations). Do you have any way to call your plugin to run a true/false check for an e-mail address? I’d like to use Ban Hammer to do the work, and it seems it would be simple to have such a call.

    Thanks.

  6. Bruce
    Bruce 23 August, 2010 at 12:42 pm ·

    I apologize – I should have looked at the plugin code first. It was very simple to add a call to ‘banhammer’ directly. And it works great! Thanks for the plugin.

  7. Burakula
    Burakula 9 November, 2010 at 8:36 am ·

    Hello,
    First of all thank you for this usefull plugin. I have a web site wordpress 2.3 version and i can not upgrade wordpress version.

    I want to ask that if it is possible to use ban-hammer on wordpress 2.3 version?

    Thanks.

  8. Karl Blessing
    Karl Blessing 9 March, 2011 at 10:04 am ·

    “Sorry, but this plugin is no longer supported on pre-3.0 WordPress installs.”

    Is the message I got during the latest update, but I’m using 3.1

  9. Ramsey
    Ramsey 2 June, 2011 at 7:38 am ·

    Hi there, does this plugin allow banning by IP addresses or blocks of IP addresses as well as emails? I have been featured on a “showcase” site and get a *TON* of ‘overseas’ traffic but my website is 99% US based. I don’t mind the traffic but when they start registering and posting “test” posts and filling up my Live website with unrelated junk “just to see how it works” its really annoying. Especially when those posts get sent to different RSS feeders and things and then CAN’T be deleted. (Thanks Google Reader.) Anyway, I’d like to allow them to still visit the site but block their registration by IP since I have no way to know what email they’re using since this isn’t technically “spam” email (as in, automated bots). Thanks.

  10. Sean Conner
    Sean Conner 14 June, 2011 at 6:30 pm ·

    Moments ago installed Ban Hammer and it works like a freaking charm. Just wanted to say THANK YOU! And also thank you.

    Cheers,
    Sean

  11. Sean Conner
    Sean Conner 14 June, 2011 at 6:36 pm ·

    … and perhaps ironically StopForumSpam.com seems to have been knocked off the net for the moment. Either by legitimate demand for their feed, but perhaps by some disgruntled spammers launching a DOS making it impossible for your plugin and others to access the live feed.

    Sad… but was still able to scrape this minimal list together that others can drop into Ban Hammer directly:

    10minutemail.com
    20minutemail.com
    anonymbox.com
    beefmilk.com
    bsnow.net
    bugmenot.com
    deadaddress.com
    despam.it
    disposeamail.com
    dodgeit.com
    dodgit.com
    dontreg.com
    e4ward.com
    emailias.com
    emailwarden.com
    enterto.com
    gishpuppy.com
    goemailgo.com
    greensloth.com
    guerrillamail.com
    guerrillamailblock.com
    hidzz.com
    incognitomail.net
    jetable.org
    kasmail.com
    lifebyfood.com
    lookugly.com
    mailcatch.com
    maileater.com
    mailexpire.com
    mailin8r.com
    mailinator.com
    mailinator.net
    mailinator2.com
    mailmoat.com
    mailnull.com
    meltmail.com
    mintemail.com
    mt2009.com
    myspamless.com
    mytempemail.com
    mytrashmail.com
    netmails.net
    odaymail.com
    pookmail.com
    shieldedmail.com
    smellfear.com
    sneakemail.com
    sogetthis.com
    soodonims.com
    spam.la
    spamavert.com
    spambox.us
    spamcero.com
    spamex.com
    spamfree24.com
    spamfree24.de
    spamfree24.eu
    spamfree24.info
    spamfree24.net
    spamfree24.org
    spamgourmet.com
    spamherelots.com
    spamhole.com
    spaml.com
    spammotel.com
    spamobox.com
    spamspot.com
    tempemail.net
    tempinbox.com
    tempomail.fr
    temporaryinbox.com
    tempymail.com
    thisisnotmyrealemail.com
    trash2009.com
    trashmail.net
    trashymail.com
    tyldd.com
    yopmail.com
    zoemail.com

    1. Gerold
      Gerold 3 January, 2012 at 5:38 pm ·

      Hi,

      I run a service called block-disposable-email.com which collects new trash-domains to make it avaliable via an api. Currently about 2.800 domains are beeing detected.

      Maybe this would be an option to integrate to Ban Hammer (there is already an cooperation with the mentioned SFS).

      Would be nice hearing from you,
      Gerold

  12. Niraj Kumar
    Niraj Kumar 13 July, 2011 at 9:39 am ·

    Really wonderful capability. However, the plugin uses has_cap, and I use the latest WordPress installation(3.2). Perhaps, in your next upgrade, you would use Roles and Capabilities, right?
    Well, thanks again for this plugin! :)

  13. Szemcse
    Szemcse 4 August, 2011 at 11:12 pm ·

    Hello,
    First of all thank you for this usefull plugin. I would like to localize WordPress 3.2.1 below, but unfortunately it did not detect the localization program is not compatible with it. The localization program names: WordPress Plugin: Localization Codestyling so you do not see it unfortunately. I wanted to promote this plugin on my website. I know I could write over the code, but better to have the developer tools that item.

  14. EBL
    EBL 5 March, 2012 at 2:44 pm ·

    What if I am being treated like Spam but I am not spam? How do I get the ban to stop?

  15. Tayler
    Tayler 5 April, 2012 at 7:37 am ·

    Just wanted to let you know this plugin is exactly what I’m looking for. I think that WordPress core should offer this functionality. Thank you.

Comments are closed.