How to disable BuddyPress admin menu bar in WordPress

To disable the BuddyPress admin menu bar in WordPress using the functions.php file, you can use the show_admin_bar filter hook. This hook allows you to modify whether the admin bar is displayed on the front-end of your site.

Here is an example of how you can use this hook to disable the BuddyPress admin menu bar:

// Disable BuddyPress admin menu bar in WordPress
// More snippets at wpunplugged.com 

function disable_buddypress_admin_bar( $show_admin_bar ) {
    if ( function_exists( 'bp_is_active' ) ) {
        $show_admin_bar = false;
    }
    return $show_admin_bar;
}
add_filter( 'show_admin_bar', 'disable_buddypress_admin_bar' );

In this example, we are using the function_exists() function to check for the existence of the bp_is_active() function, which is specific to the BuddyPress plugin. If the function exists, it means that BuddyPress is active, and we set the $show_admin_bar variable to false to disable the admin bar.

It’s important to note that this code will only disable the BuddyPress admin menu bar on the front-end of your site. The admin bar will still be displayed in the WordPress admin area.

Share this post

You might also like...

Comment

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