How to Hide Search Form if User Not logged-in in BuddyPress Site

In this tutorial, I will explain how to hide search form if user not logged-in in BuddyPress site. This is a simple and easy BuddyPress snippet which will hide the BuddyPress search form if the user logged out.

How to Hide Search Form if User Not logged-in in BuddyPress site

How to Remove Search Form if User Not logged-in in ByddyPress

In this code we have used the CSS property display: none; within the PHP code to hide the search form. Open the functions.php file and add the following snippet at the end of the file.

If you don’t want to edit your functions.php file, then create a new file as bp-custom.php inside the /wp-content/plugins/ folder and add the above code.

After adding the above code the search form will be hidden for the visitors.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , , ,