Support » Plugin: BuddyPress Activity Privacy » How to set default activity privacy level

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author meg@info


    Hi @creativedan,

    Yes, you can do it and easly by adding this code to your functions.php of your current theme.

    add_filter('bp_profile_activity_visibility_levels_filter', 'bp_make_logged_in_as_default_privacy_level', 10, 1);
        add_filter('groups_activity_visibility_levels', 'bp_make_logged_in_as_default_privacy_level', 10, 1);
        function bp_make_logged_in_as_default_privacy_level( $visibility_levels ) {
            $visibility_levels['public']['default'] = false;
            $visibility_levels['loggedin']['default'] = true;
            return $visibility_levels;

    Hi meg@info,

    You’re certainly a great contributor to the BuddyPress community!

    I’m after something similar to this, but based on user roles e.g.

    1) Subscribers are forced to only be able to post updates to their friends

    2) Higher level roles are able to post universal updates, as per BP’s default behaviour

    This would mean the site works like Facebook for normal users, but admins, authors etc. will still be able to post public announcements.

    Is this possible?

    Plugin Author meg@info


    Hi @ljmac,

    You can do (1) and (2) by adding code that check the role of the current, and depending the role of the current user just add the corresponding filter.

    it just explain code

    If (im-subscriber){
      add_filter('bp_profile_activity_visibility_levels_filter', 'bp_subscribers_privacy_level', 10, 1);
    } elseif(i-have-Higher level roles){
      add_filter('bp_profile_activity_visibility_levels_filter', 'bp_higher_level_roles_privacy_level', 10, 1);
    function bp_higher_level_roles_privacy_level( $visibility_levels ) {
       //add or unset new capability levels (like
    .. .
      return $visibility_levels;
    function bp_subscribers_privacy_level( $visibility_levels ) {
    . ... other unsets
            return $visibility_levels;

    Thanks meg@info! I take it this code can be added to bp-custom.php?

    I’ll probably come to grips with this next week – I’ll let you know if I need any further help then.

    Dear author of this awesome plugin. I have tested your plugin but when I set the status for only loggin users, other non login people can still see the status. Please help me solve this issue. Thanks.

    Thanks for getting back to me, and sorry for my delayed reply.
    Where should I input the code you suggested, specifically?
    My website’s theme is not natively compatible with BuddyPress,
    but I do have the latest version of BuddyPress.

    A specific outline of what to do would be very helpful, thanks.

    I’m still somewhat new to WordPress,
    and still only a novice at programming,
    so apologies for my lack of comprehension.

    In the folder of your theme is a file called “functions.php”. Put the suggested code right after the last line of that file.

    Hi @megainfo

    Great plugin thanks – I’ve used the code you provided above to change the default visibility to “friends only” and all is good…except these three activity updates:
    1. “user” became a registered member;
    2. “user” changed their profile picture;
    3. “user” and “user” are now friends

    still appear to all users, rather than just the “user”‘s friends.

    Please can you tell me how I can make these three updates “friends only” also?

    Many thanks


    My apologies – I’ve just seen that this thread is marked as resolved. So please ignore my previous comment and I’ll start a new thread with the same question. Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to set default activity privacy level’ is closed to new replies.