![]()
If you’ve ever managed a BuddyPress site, you know that SPAM registrations quickly became the bane of your existence. When we built NetDivvy, we were cleaning out thousands of spammy user records every single day. It didn’t take long for me to start brainstorming ways to get rid of the problem.
To solve this problem, I’ve seen people add image verification (captcha) or other user entry field to the registration process to verify that the user was human. Personally, I’ve always hated captchas, so I wasn’t about to subject our users to that torture. They’re so frustrating sometimes that I’ve made the decision to not sign up for a web site because they employed them.
So if we’re not going to burden our users with extra fields to fill out, how are we going to stop these spam bots?
We treat them like thieves. They’re stealing our most valuable asset, time. Just like in the movies, we have to outsmart them – we have to set a trap. In the computer world, we call this a honeypot. But in order for it to work, we have to get into their virtual heads and think like they do. Much like you do with a mouse trap, you have to tempt the spam bot with something they want. So, what are spam bots are looking for? Inputs to fill out.
Here’s the plan.
- Create an extra text field hidden via CSS
- Since it’s hidden from view, users won’t see it or fill it out
- Spambots will usually fill out all form elements so they don’t miss any required fields
- Upon submission, check the hidden text input to see if it has a value. If it does, it’s a spammer.
Sounds straight forward, right? After implementing this on NetDivvy, we have gone from thousands of SPAM registrations per day to one or two per week. Since it’s been so helpful to us, we’ve decided to release the functionality to the public. We’ve created a plugin that you can install and it will just work.
You can download the plugin here.
If you’re interested in seeing the code, continue reading.
First, we utilize the ‘bp_after_signup_profile_fields’ BuddyPress action to add our hidden text field.
We then check to see if the input is empty via the ‘bp_core_validate_user_signup’ filter and return an error if it is filled in. BuddyPress and WordPress take care of the rest.
If you find any errors, or have any additions, please submit an issue on the github repo.

11 Comments
I really appreciate this plugin and you sharing it. I’m having trouble with the format of the readme file. Can you make a text file available?
@Mike, by “readme file” are you referring to the code that is shown in the post? If so, you can find that code with these two Gist links:
https://gist.github.com/3748153 and https://gist.github.com/3748153
Brandon..
Thank Buddha… we’ve been getting slammed off & on for months – manual approval, by sending activate link to admin instead, has been lotsa fun – your clever trick works like a charm right out of the box!
Count me ‘relieved’ to not have 20-spam registrations per hour, all / every day, needing review..
Many (many-many-So-many) Thanks for sharing..
Hi there,
Thanks for your plug in. I have a question though. How do we know who has filled in (spam bot) that field who hasnt? Where do we check that? I see nothing at the back end and under the list of users ?
Gregory, you won’t see them in the user table. If it’s working correctly, you will see a reduction in spam users being registered in your network.
So we wont see anything who and how they get trapped!! Can we at least tes this? What do I look for with firebug?
You won’t see any spam users in the system (that’s kind of the idea). One idea, if you really want to see them, would be to modify the validate script to set the spam flag in the users table for that user instead of denying them membership. If you end up going this route, I’d love to see what you come up with.
I did not go that way Brandon. I see some days after that spam users did not stop registering. It almosts seems to be impossible to stop this from happening and Im even more impressed how the buddypress community hasnt done something about it.
Im using your plugin, SI captcha, AVH First Defense Against Spam and even directing traffic throug Cloudflare. No results …. spammers registering everyday.
Do you maybe have any suggestions what else could have been tried?
Gregory, are you seeing all of your signups coming from a specific domain, or a common domain extension? If so, you could add some code to our plugin that would catch those domain names too.
Nice tutorial!. Nice tips to use. Spamming is bad for business and buddypress is not doing anything to stop it. I own a buddypress site and followed this tips here
http://techblogsite.com/how-to-protect-your-buddypress-site-from-spam-registration/
This work like a charm. No spam registration
I had tons of spam registrations coming in to my ByddyPress. At worst it made me consider shutting it down and/or swap to other platform.
Using captchas, questions, hidden fields etc I made it to all time low to some 10-15 that made it through for manual cleaning. But even so. This caused me to once a week manually having to clean out activity, groups and accounts — besides having to understand that during this week my site had all kind of weirdo url-black-hat-seo:s going on risking google to consider the site to be a url-farm.
The one and only turn key solution that fixed it permanently and down to a zero-spam-registration was installing the plug in Wanguard and then enabling a security question.
Now I can see in the configuration that it kills 100 % of the spam registrations, it is a blessing and it is awesome to see that Wanguard is such a success.