1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Disable Registration Validation

How to Disable Registration Validation

Introduction

BuddyBoss does not provide a built-in option to disable registration validation. By default, new users must complete the activation/validation process before their accounts become active. However, you can bypass this behavior using a custom function that automatically activates users upon registration.

Custom Workaround

Before proceeding, make sure you have a complete site backup.

  1. Go to Appearance > Theme Editor in your WordPress admin dashboard.
  2. Under Select theme to edit, choose your active theme (preferably a BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, open Theme Functions (functions.php).
  4. Add the following code just before the closing PHP tag (?>):
function disable_validation( $user_id ) {
    global $wpdb;

    // Ensure the user is marked as active
    $wpdb->query(
        $wpdb->prepare(
            "UPDATE $wpdb->users SET user_status = 0 WHERE ID = %d",
            $user_id
        )
    );

    // Get all inactive signups
    $users = $wpdb->get_results(
        "SELECT activation_key, user_login FROM {$wpdb->prefix}signups WHERE active = '0'"
    );

    foreach ( $users as $user ) {

        // Activate the signup
        bp_core_activate_signup( $user->activation_key );
        BP_Signup::validate( $user->activation_key );

        // Assign default role
        $user_id = $wpdb->get_var(
            "SELECT ID FROM $wpdb->users WHERE user_login = '$user->user_login'"
        );

        if ( $user_id ) {
            $u = new WP_User( $user_id );
            $u->add_role( 'subscriber' );
        }
    }
}

add_action( 'bp_core_signup_user', 'disable_validation' );
add_filter( 'bp_registration_needs_activation', '__return_false' );
add_filter( 'bp_core_signup_send_activation_key', '__return_false' );
  1. Click Update File to save the changes.

This code automatically activates newly registered users, skips email activation, and assigns them the Subscriber role.

Note: Modifications are typically considered custom work, but we are making an exception in this case. Please review the BuddyBoss Support Policy.

Troubleshooting and FAQs

Q: Users are still receiving activation emails.
A: Make sure all three filters (bp_registration_needs_activation, bp_core_signup_send_activation_key, and the action hook) are present and added correctly. Clear any caching plugins and test again.

Q: Will this affect existing users?
A: No. This only affects new registrations going forward.

Q: Is this safe to use on public sites?
A: Disabling validation increases the risk of spam registrations. It’s recommended to pair this with CAPTCHA, reCAPTCHA, or other anti-spam measures.

Q: Can I revert this change easily?
A: Yes. Remove or comment out the code from functions.php and save the file.

Q: Will this work with custom registration forms?
|A: It works with BuddyBoss/BuddyPress-based registrations. Third-party registration plugins may require additional handling.

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

To speak to our Agency consultant, fill in the form found at our Contact Page.

  • Get Started

    Enter your name and email address to get started with your project...

  • This field is for validation purposes and should be left unchanged.