BuddyPress anti-spam techniches – Registration honeypot

A hidden “honeypot” field in your registration form is a great way to catch out signup bots and scripts – a bot or script will blindly enter text into the field, but humans won’t see it and, therefore, won’t 😉

Add the following to your (child) theme’s functions.php:

function add_honeypot() {
    echo '<div style="display: none;"><input type="text" name="system55" /></div>';
function check_honeypot() {
    if (!empty($_POST['system55'])) {
        global $bp;

That’s it! Don’t forget to add a page with the slug “spam-prevention” to your site which explains to the user that they did something that looks spammy…