How to Hide the BuddyPress Admin Bar (aka BuddyBar)

I’ve seen a bunch of sites that supposedly show you how to do this, but none are complete.  I have a client who wants to use BuddyPress, but doesn’t want the Admin Bar (I call it the BuddyBar) across the top of every page.  So I’m building a plugin called BuddyBar Widget that includes a sidebar widget with all the BuddyBar links in it.  Another part of the plugin hides the BuddyBar completely, even when you’re on Dashboard.

To hide the BuddyBar from users that aren’t logged in, go to the BuddyPress General Settings page and select “Yes” for the Hide admin bar for logged out users? option.

That’s great, but it doesn’t hide it if you ARE logged in.  For that, we’ll need some code.

EDIT ( February 1, 2012):

Ignore the old post from below. After trying to get that to work properly, I’ve switched to something far more effective. Paste the code snippet below into your wp-config.php file. I put it right above the “Authentication Unique Keys and Salts.” comment block. THis works for sure. It’s not what I had hoped to do, but it works.

/** Disable the WP Admin Bar */
define('BP_DISABLE_ADMIN_BAR', true);



CODE BLOCK REMOVED


I created a function (I'm calling it remove_buddyadminbar), then used define to tell WordPress to turn off the BuddyBar.  This, by itself, will turn off the BuddyBar.  It may complete overkill, but I also use remove_action hooks as well.  BuddyPress uses the add_action hook in the WordPress footer to activate the BuddyBar.  Remove_action simply negates that call from BuddyPress.  You'll notice, I also include the call for the admin_footer, which should hide the bar on your admin pages, including Dashboard.

While that's all well and good, now you'll notice a nice gap at the top of your admin pages.  When you kill the BuddyBar for the Dashboard, it doesn't undo the CSS formatting that creates room for it at the top of your admin pages.  This bit of CSS takes care of that:
CODE BLOCK REMOVED


Using those two bits of code will completely eliminate the BuddyBar from appearing on your site.  I'll post again about this when the plugin is ready to ship.

BuddyPress

Last May, I read about BuddyPress, a new plugin from Automattic, which also produces WordPress, that would bring social networking to WordPress blogs.  I immediately began dreaming up ways to create a community of my music’s fans.  Then I read up on it.  It required WordPress MU, which allows you to create blog networks (like for a school, company, etc).  Since I wasn’t running MU, and didn’t know any bands that were, I forgot about it.

BuddyPress 1.2 was released Friday, February 26th and can be used with a single WordPress install, so we can all have social networks related to our band blogs!  However, I’m a little hesitant: do our fans need yet another social network?  While I’m sure there are bands that could easily support their own (think: Phish, Dave Matthews Band, or KISS to name a few), most of us don’t have enough fans to justify it.  We’re better off with sticking to Myspace, Facebook, and Twitter because our fans are already on those sites.

Before you think I’m just being pessimistic, I’m in favor of using this plugin.  I just wonder how effective it will be for most artists.  If you have a community created around your band already, this will work well to help you unite them.  For the rest of us, it could assist you in building that community around your music.  Either way, this is a good step for this plugin and I hope to start working it into some artist blogs to see if it’s helpful or just another useless social network.  Once I have some first-hand knowledge, I’ll write some more (but I’ll bet you see this plugin in the next version of my book).