1. Home
  2. Knowledge Base
  3. Customizations
  4. CSS
  5. Hide Search Icon for Logged-Out Users

Hide Search Icon for Logged-Out Users

Introduction

By default, BuddyBoss displays the search icon for all users, including those who are logged out. If you want to hide the search feature for logged-out users to simplify navigation or restrict access, you can use a custom CSS snippet. Different header styles require slightly different code.

Custom Workaround

For Header Styles 1, 2, and 3:

  1. Go to BuddyBoss > Theme Options
  2. Under Custom Codes, enable CSS
  3. Append the following CSS:
body:not(.logged-in) ul#primary-menu li:nth-child(6),

body:not(.logged-in) a.header-search-link {

    display: none !important;

}
  1. Click Save changes

For Header Style 4:

  1. Follow the same steps above
  2. Append the following CSS instead:
.header-style-4:not(.logged-in) .search-form {

    display: none !important;

}
  1. Click Save changes

This will hide the search icon and search form for logged-out users depending on your header style.

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

Troubleshooting and FAQs

Q: Will this hide the search for logged-in users?

A: No. This CSS targets only logged-out users using body:not(.logged-in).

Q: How do I know which header style I’m using?

A: Go to BuddyBoss > Theme Options > Header to check your active header style.

Q: Can I hide other menu items for logged-out users?

A: Yes. You can use a similar CSS approach targeting specific menu items by their position or class.

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.