By default, BuddyBoss includes a “Public” option in the “Who can see your post?” dropdown. However, for community platforms that require restricted visibility—such as private communities—you might want to remove this option and ensure posts are only visible to logged-in users, friends, or groups.
In this tutorial, you’ll learn how to:
- Remove the “Public” visibility option from the dropdown.
- Set a custom default privacy level.
- Override the BuddyBoss template.
- Add custom CSS and JavaScript to complete the functionality.
🔧 Why Remove “Public” Visibility?
If your platform is intended only for members or private groups, having the “Public” option may introduce unwanted exposure. BuddyBoss hardcodes “Public” in its activity post template, and unfortunately, there’s no built-in filter to override this setting—so we need to manually modify the behavior.
🪜 Step-by-Step Guide
✅ 1. Handle Existing Public Posts
Before removing the Public option, make sure to:
- Update existing activities that are publicly visible.
- Change their visibility to “Logged In Users” or another appropriate level using a custom script or manual moderation.
🔁 2. Override the Template to Customize Visibility Options
BuddyBoss uses a JS template to render the visibility dropdown.
🗂 Template File to Override:
buddyboss-platform/bp-templates/bp-nouveau/buddypress/common/js-templates/activity/parts/bp-activity-post-case-privacy.php📁 Copy to Your Child Theme:
buddyboss-theme-child/buddypress/common/js-templates/activity/parts/bp-activity-post-case-privacy.php🧩 Custom Template Code:
Replace the template content with the following:
<script type="text/html" id="tmpl-activity-post-case-privacy">
<div id="bp-activity-privacy-point" class="{{data.privacy}}" data-bp-tooltip-pos="up" data-bp-tooltip="<?php esc_html_e( 'Set by album privacy', 'buddyboss' ); ?>">
<span class="privacy-point-icon"></span>
<span class="bp-activity-privacy-status">
<# if ( data.privacy === 'group' ) { #>
<?php esc_html_e( 'Group', 'buddyboss' ); ?>
<# } else if ( data.privacy === 'friends' ) { #>
<?php esc_html_e( 'My Connections', 'buddyboss' ); ?>
<# } else if ( data.privacy === 'onlyme' ) { #>
<?php esc_html_e( 'Only Me', 'buddyboss' ); ?>
<# } else { #>
<?php esc_html_e( 'All Members', 'buddyboss' ); ?>
<# } #>
</span>
<i class="bb-icon-f bb-icon-caret-down"></i>
</div>
</script>This ensures that the public visibility is no longer selectable or rendered incorrectly.
🎨 3. Hide the “Public” Option with CSS
This will visually remove the Public label and disable the ability to select it.
📍 Instructions:
- Go to BuddyBoss > Theme Options
- Under Custom Codes, enable CSS
- Paste the following code:
body.activity #activity-post-form-privacy label[for="public"] {
display: none;
}
body.activity .bb-media-privacy-wrap .activity-privacy li[data-value="public"] {
pointer-events: none;
opacity: 0.5;
cursor: not-allowed;
}💻 4. Force Default Privacy to “Logged In Users” with JavaScript
BuddyBoss may still send the privacy=public value via AJAX. You can intercept and modify it to privacy=loggedin.
📍 Instructions:
- Go to BuddyBoss > Theme Options
- Under Custom Codes, enable JavaScript
- Add this script:
jQuery(document).ajaxSend(function(event, jqXHR, options) {
if (
options.url.includes('wp-admin/admin-ajax.php') &&
options.type === "POST" &&
options.data.includes('privacy=public') &&
options.data.includes('action=post_update')
) {
// Replace "public" with "loggedin"
options.data = options.data.replace('privacy=public', 'privacy=loggedin');
}
});💾 5. Save and Test
- Make sure to clear any caching (server, browser, and plugin).
- Test the activity post functionality to confirm that:
- The “Public” option is hidden.
- The default is correctly changed to “Logged In Users” or your chosen value.
- Posts are saved with the new default privacy setting.
🧠 Final Thoughts
Removing the “Public” option helps keep your community private and secure. With just a few lines of custom code and template overrides, you can better control who sees what inside your platform.
Need help tailoring this for other privacy defaults like Friends or Only Me? Let me know—I’d be happy to help customize it!
