BuddyDev

BuddyPress Friends Only User Profile Privacy

Making your BuddyPress user profiles friends only is easy. I have seen a lot of people asking about it and today, we will see how to do it.

Our goal is to restrict access to user profiles to everyone except:-

  • Self:- The user themselves should be allowed to access their profile.
  • Site Admins:- There should be no restriction in site admins
  • Friends:- Users who are friends with the user being visited
  • Friendship requested:- Users who have been requested friendship by the profile owner.

You can add the following code to your to theme's functions.php or bp-custom.php in your wp-content/plugins directory

 

You can changeĀ $where_to_redirect to point to anywhere you want the users to be redirected.

Have fun!

2 Responses to BuddyPress Friends Only User Profile Privacy

  • What would be really great would be to make it so that each member of your community could choose to have this for their profile but an overall community setting of site members able to view all profiles.

    Possible to make a plugin to do that?

    Dale.