Introduction
BuddyBoss does not automatically make new members follow a specific user. You can set up an auto-follow for one user by adding a small custom function to your active theme. This ensures that every newly registered member automatically follows the user you specify. This guide explains how to auto follow one user on member registration.
Custom Workaround
Before proceeding, make sure you have a complete site backup.
- Navigate to Appearance > Theme Editor in your WordPress admin dashboard.
- Under Select theme to edit, choose your active theme (preferably BuddyBoss Child Theme), then click Select
- From the Theme Files list, open Theme Functions (functions.php)
- Add the following code just before the closing PHP tag (?>):
/* Auto follow a specific user */
function lauralisa_followjlearn( $user_id ) {
if( !$user_id ) return false;
$jlearn = 80; // Replace 80 with the user ID you want new members to follow
bp_start_following( array(
‘leader_id’ => $jlearn,
‘follower_id’ => $user_id
) );
}
add_action( ‘bp_core_activated_user’, ‘lauralisa_followjlearn’ );
- Click Update File to save the changes
Troubleshooting and FAQs
Q: The new members are not auto-following the user
A: Ensure the user ID in $jlearn exists and the code is correctly added before the closing ?> tag
Q: Can I auto-follow multiple users
A: Yes. You can call bp_start_following multiple times inside the function for each user ID
Q: Will this affect existing members
A: No. This code only runs when a new user completes registration