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/.

To ensure that users are redirected back to the referring page after logging in, you can use the login_redirect filter to handle the redirection. 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 “?>”:

function custom_login_redirect($redirect_to, $request, $user) {
// Define your custom URL
$custom_url = 'https://yourcustomurl.com/custom-page';

// Check if there is a referer URL
if (!empty($_SERVER['HTTP_REFERER'])) {
return $_SERVER['HTTP_REFERER'];
}

// Use custom URL if no referer is available
return $custom_url;
}
add_filter('login_redirect', 'custom_login_redirect', 10, 3);

NOTE: Please make a backup of your site.

$custom_url:

Replace 'https://yourcustomurl.com/custom-page' with the URL you want to redirect users to by default. You need to add page link on $custom_url = 

5. Click “Update File”.