How to Remove Search Bar in BBPress Forums?

Do you want to remove the search in BBPress forums?

There are many scenarios where you want to restrict a user to search through your forums. I encountered one of them when one of my clients asked me to remove the search bar from the forums.

I used the below code to remove the search bar from the top of the BBPress forums.

php
/**
 * Remove Search Bar in BBPress Forums
 *
 * @param array $param
 * @return bool
 */
function maverick_bbp_no_allow_search($param)
{
    return false;
}
add_filter('bbp_allow_search', 'maverick_bbp_no_allow_search');

Or you can use the below code.

php
/**
 * Remove Search Bar in BBPress Forums
 */	
add_filter( 'bbp_allow_search', '__return_true' );

Leave a Reply

Your email address will not be published. Required fields are marked *