Skip to:

Buddypress Profile privacy for non-friends

  • Eyal


    i was looking around for a privacy solution in buddypress. Means, that a user will not be able to see a non friend’s profile. There is a plugin called “BuddyPress Profile Privacy” that work great for some people. However for me and for many other the plugin gives error and i couldn’t find a fix for it.
    i did manage to find a solution that for now seems to work for me. the original function of the function below i found here ( thanks to Richie_KS. the original function direct a user to a different page (non-friend.php) when he is trying to see a non friend profile. which can work just fine. However, i changed the function and now if i will go to a non friend page i will see his picture , “Add Friend” button and “Send private message” button. but no profile information will be displayed. This way i can also choose in which pages to block the information. (profile , activity , blogs…..)

    few simple steps :

    1) paste this function in your function,php :

    check if member is a friend


    function bp_displayed_user_is_friend() {
    global $bp;
    if ( bp_is_profile_component() || bp_is_member() ) {
    if ( (‘is_friend’ != BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $bp->displayed_user->id )) && (bp_loggedin_user_id() != bp_displayed_user_id()) )
    if ( !is_super_admin( bp_loggedin_user_id() ) )

    return true;

    2) i created a template file called “not-friend.php” where i put the message i want to be displayed . this is how mine looks like :


    This information is avaliable only for friends



    * i uploaded the file to the buddypress theme folder under /members/single/

    2) now you can go to the pages you want to make private (pages found in buddypress theme folder under /members/single) and add this to the top of the page:


    here goes the original information of the page.

    and add this below the information( should be at the bottom of the page):


    as for now it works great for me. if any of you try it and find something wrong please let me know.

Viewing 5 replies - 1 through 5 (of 5 total)

  • mayankjain


    Works well for me. Thanks!

    I appreciate the contribution, but sometimes you can’t easily identify a person to determine if you should friend them (or find someone to send friend requests to) unless you view their profile.

    Ultimately, I think we need per-field privacy controls.

    If I was looking to pay someone, how hard would it be to add per-field privacy controls? BuddyPress is good but the whole lack of privacy has me seriously looking at Mingle.

    What is the best way to get in touch with coders if I’m willing to pay for this and other custom development?

    So a little bit more searching found this:
    Which has had no attention for 17 months until cnorris23 jumped on board 3 days ago.

    and this
    which has some attention and actual code by cnorris23. You go guy!

    I just don’t understand why this critical functionality has had no attention. Hopefully cnorris23 will make some progress.



    The same for me. Found solutions that worked until bp 1.2.10 but not on 1.5.
    Made the changes from cnorris23 – it’s working. Sadly, these changes will be blown away with the next update and have to be done again – hope, this solution work then at least.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Buddypress Profile privacy for non-friends’ is closed to new replies.
Skip to toolbar