I'm making a community social media website using BuddyBoss's Boss theme. I'm also using Buddypress.

Since I want my website to be private, what I want to do is to disable the search function for anyone who isn't logged in to the website.

The titlebar or header of that theme is fixed meaning that search isn't just a widget but an actual part of the titlebar.

Also, can you tell me the best plugin to restrict access to the website to only the logged-in members so that others can't see anything but one single sign-in or register page.

I'm guessing it can also be done by is_logged_in function but I'm unfamiliar with php coding and would very much appreciate it if you help me out.

If it cannot be done without editing files then, here is a link to a few php files like header.php, search.php, etc.


1 Answer 1


You can restrict any area with is_user_logged_in() function. For example: If you want to hide search for non-logged-in users then enclose search DIV inside this function like this

if(is_user_logged_in()) {
    <div class="search">

Search for the DIV that contains Search Box and apply function as shown above. By this way you can restrict any area for non-logged-in users.

NOTE: Since you are new in PHP, Don't forget to enclose this function inside php tags (<?php ?>). And also make sure you don't open <?php for this function if it already being opened.

And about your Plugin suggestion, Plugin recommendation is off-topic here. We cannot suggest any plugin as per the site rules, So you have to find your desired plugin by yourself.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.