1. Home
  2. Knowledge Base
  3. Customizations
  4. CSS
  5. Hide Widgets From Logged-Out Users

Hide Widgets From Logged-Out Users

Introduction

By default, BuddyBoss does not provide an option to hide widgets for logged-out users. Using a simple CSS snippet, you can hide sidebar widgets when users are not logged in and center the main content layout for a cleaner appearance.

Custom Workaround

Follow the steps below to hide widgets for logged-out users:

  1. Go to BuddyBoss > Theme Options
  2. Under Custom Codes, enable CSS
  3. Append the following:
body:not(.logged-in) div#secondary,

body:not(.logged-in) div#secondary-right {

    display: none;

}

body:not(.logged-in) div.bb-grid {

    justify-content: center;

}
  1. Save changes.

Note: Any modifications are considered as custom work already. Know more about our Support policy here: https://buddyboss.com/support-policy/

Troubleshooting and FAQs

Q: Will this remove widgets for logged-in users as well?

A: No. This CSS only applies to logged-out users. Logged-in users will still see the widgets.

Q: The widgets are still visible after adding the CSS. What should I do?

A: Clear your site cache and browser cache. If the issue persists, check if your theme uses different sidebar IDs.

Q: Does this affect mobile views?

A: Yes. The widgets will be hidden for logged-out users on all screen sizes, including mobile.

Q: Can I hide only specific widgets instead of the entire sidebar?

A: Yes. You can target specific widget classes or IDs instead of the entire sidebar container.


Screenshots

Logged-in

Logged-out

A comment by Difficult bem 324 encouraging perseverance comparing learning from failure to a child learning to walk and emphasizing the importance of support systems There are emojis of walking and a heart at the end

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

This field is for validation purposes and should be left unchanged.
This field is hidden when viewing the form

To speak to our Agency consultant, fill in the form found at our Contact Page.