1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. Redirect Users to the Login Page After Account Creation, Bypassing the “Successfully Registered” Page

Redirect Users to the Login Page After Account Creation, Bypassing the “Successfully Registered” Page

Please be advised that there’s currently no out-of-the-box option to do this in BuddyBoss. Modifications are typically considered custom work, but we are making an exception in this case. Kindly check our Support Policy here: https://www.buddyboss.com/support-policy/. Kindly try adding the following code in your theme files:

1. Go to Appearance > Theme File Editor

2. Under “Select theme to edit”, choose (BuddyBoss Child/Whatever theme is active), then click “Select”.

3. Below Theme Files, select Theme Functions (functions.php).

4. Append the following just before the closing PHP tag “?>”:

remove_action( 'bp_actions', 'bp_members_action_activate_account_custom' ); function bp_members_action_activate_account_custom() { if ( ! bp_is_current_component( 'activate' ) ) { return; } if ( is_user_logged_in() ) { return; } if ( ! empty( $_POST['key'] ) ) { $key = wp_unslash( $_POST['key'] ); // Backward compatibility with templates using `method="get"` in their activation forms. } elseif ( ! empty( $_GET['key'] ) ) { $key = wp_unslash( $_GET['key'] ); } if ( empty( $key ) ) { return; } $bp = buddypress(); $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) ); // If there were errors, add a message and redirect. if ( ! empty( $user->errors ) ) { bp_core_add_message( $user->get_error_message(), 'error' ); bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) ); } bp_core_add_message( __( 'Your account is now active!', 'buddyboss' ) ); bp_core_redirect( 'http://buddyboss.local/login/' ); } add_action( 'bp_actions', 'bp_members_action_activate_account_custom' );

Note: The function bp_core_redirect( ‘http://buddyboss.local/login/‘ ); redirects users to the login page instead of the confirmation page. Please make a backup of your site.

5. Click “Update File”.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Support

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.

Not recently active