Stephanie Leary

Writer and WordPress consultant

  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Fascism Watch (2016-17)
    • Content Modeling for WordPress series
    • WordPress Hidden Gems series
  • Work
    • Portfolio
    • Services
    • WordPress Plugins
    • WordPress Themes
    • Presentations and Interviews
    • on GitHub →
  • About
    • Press Kit
  • Contact
    • Mailing List

Stopping spam accounts on BuddyPress

February 1, 2011 Stephanie Leary 1 Comment

In chatting with a few people at WordCamp Phoenix about our various BuddyPress sites, the issue of spam user accounts came up several times. I’d just run into this problem myself on the VP Alumni site, and after cleaning out about 400 bogus users (all with usernames like maryjane913), I went searching for a way to stop them without subjecting real people to a CAPTCHA (or something equally irritating).

The method described by stwc in the forum is working well for me, even though I did only the last two steps s/he described.

First, I changed the slug of the BuddyPress registration page, which usually lives at example.com/register. You do this using a definition in wp-config.php:

define ( 'BP_REGISTER_SLUG', 'newbpuser' );

I chose a new slug that did not involve the word “signup” at all, which might have helped.

Second, I used stwc’s function to redirect visitors from the built-in WordPress signup page, wp-signup.php, to the BuddyPress registration page instead.

function bp_splog_signup_redirect() {
        if (strpos($_SERVER['REQUEST_URI'], 'wp-signup.php') !== false ) {
                $url = 'http://example.com/newbpuser';
                wp_redirect($url);
                exit;
        }
}
add_action('init', 'bp_splog_signup_redirect');

You could just add a redirect above the WordPress rewrite rules in .htaccess instead, I suppose, which would continue to work if you change themes:

Redirect /wp-signup.php http://example.com/newbpuser [R=301,NC]

So far, I haven’t had any new spam accounts at all since I implemented the changes. Maybe someday BuddyPress (or WordPress itself) will integrate with Akismet or something for signups, but in the meantime this seems to be the least painful solution.

WordPress akismet, buddypress, spam, splogs

Comments

  1. John says

    June 14, 2011 at 11:16 am

    Any new discoveries on Spam?

    Thanks in advance

    John

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Fascism Watch

The Fascism Watch is a daily(ish) news roundup. View all the previous Fascism Watch posts »

Latest WordPress Book

Content Strategy for WordPress

A short book for content strategists and managers on implementing a complete content strategy in WordPress: evaluation, analysis, content modeling, editing and workflows, and long-term planning and maintenance.

Read the sample chapter

Kindle Nook iBooks Kobo Smashwords

WordPress for Web Developers

WordPress for Web Developers (9781430258667)

This is a book for professional web designers and developers who already know HTML and CSS, and want to learn to build sites with WordPress. The book begins with a detailed tour of the administration screens and settings, then digs into server-side topics like performance and security. The second half of the book is devoted to development: learning to build WordPress themes and plugins.

This is the second, much-revised and updated edition of Beginning WordPress 3, with a more accurate title. Everything’s been updated for WordPress 3.6.

WordPress for Web Developers is out now. See what's inside...

The best WordPress features you’ve never noticed

  • WordPress Hidden Gems: Screen Options
  • WordPress Hidden Gems: Bulk Edit
  • WordPress Hidden Gems: Private Status
  • WordPress Hidden Gems: Dashboard Feed Readers
  • WordPress Hidden Gems: Options.php

Content Modeling for WordPress series

  • Content modeling for WordPress, part 1: analyze content
  • Content modeling for WordPress, part 2: functional and organizational requirements
  • Content modeling for WordPress, part 3: a sample content model

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Copyright © 2021 Stephanie Leary