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:
- Go to BuddyBoss > Theme Options
- Under Custom Codes, enable CSS
- 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;
}- Click Save changes
For Header Style 4:
- Follow the same steps above
- Append the following CSS instead:
.header-style-4:not(.logged-in) .search-form {
display: none !important;
}- Click Save changes
This will hide the search icon and search form for logged-out users depending on your header style.
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.