What Everybody Ought to Know about the WordPress Admin Bar

In WordPress 3.1, a lot of cool features were added. Among those features was the WordPress Admin Bar. In this article, we will cover what is a WordPress admin bar, why it was added, and how you can utilize it for your benefits. This article will also show you how to remove the WordPress Admin Bar, how to remove links from the admin bar, how to add links in the admin bar, and much more.

What is the WordPress Admin Bar?

If you have used a WordPress.com blog, then you are already familiar with this. In WordPress 3.1, an administration bar was added to connect the back end to the front end of your blog. This feature will be most useful for people on multisite installs because they can add other useful links, advertisement, and much more on the admin bar for their registered users. It is also good for single-site users because it provides 1-click access to the dashboard.

Why the WordPress Admin Bar?

According to Matt Mullenweg, this is the “first step toward a front-end editor”. The admin bar certainly makes life easier for a lot of beginners because it easily lets you edit the posts, write a new post, check the updates, get short-link, and more. We really like it because now our editors don’t have to look further to find a branded short-URL for our page. We have added it in our admin bar. It would be interesting to see how this Admin Bar evolves in the future versions.

Now lets get into what you can do with this Admin Bar. First thing would be how to remove it. A lot of people had an uproar about the admin bar because it was annoying.

How to Disable WordPress Admin Bar

The developers of WordPress made it really easy for you to disable the Admin Bar. Simply go to Users » Your Profile. Then simply check off the following:

But this is per user basis. If you are working on a site for a client and you want to get rid of it for each user, then simply open your theme’s functions.php file and paste the following code:

add_filter( 'show_admin_bar', '__return_false'

The code above will get rid of the admin bar, but it will leave the remains on the user profile page. To get rid of that, lets add this code:

Now what would be interesting is to have the option to move the WordPress Admin Bar to the left or the right (similar to HootSuite backend). Designers can make it really interesting (giving WordPress a web app look in the front-end).

How to Remove Links from the WordPress Admin Bar

If you are interested in customizing the WordPress Admin Bar for your site or network, then you might not want all the links. Simply open your theme’s functions.php file and add this code:

The trick to this function is by knowing the IDs used for each link. You can find the IDs for the default links in WordPress 3.1 by looking the file: /wp-includes/admin-bar.php

Here are some of the default IDs:

my-account / my-account-with-avatar: the first link, to your account. Note that the ID here changes depending on if you have Avatars enabled or not.my-blogs: the ‘My Sites’ menu if the user has more than one siteget-shortlink: provides a Shortlink to that pageedit: link to Edit [content-type]new-content: the ‘Add New’ dropdowncomments: the ‘Comments’ dropdownappearance: the ‘Appearance’ dropdownupdates: the ‘Updates’ dropdown

How to Add the Links in WordPress Admin Bar

If you are a plugin author, or a theme developer, you can certainly hook into the admin bar to make things easy. Plugins like WordPress SEO by Yoast, or WP-Bitly already does that. Here is a simple way of doing that, paste the following codes in your theme’s functions.php file:

If you want to create your own drop down in the admin bar, Michael Martin has a pretty good tutorial on it.

Now this can feature can be abused by plugin developers. We have not seen it yet, and we hope that it stays this way. Only plugins that absolutely have to be added to the admin bar should be added. Most importantly, all plugin authors who do add their functions in the admin bar should have a check box to turn it off.

16 Comments

I cannot find ANYWHERE that gives direction on how to HIDE/SHOW toolbar in the comments section in WordPress. There is this huge box people can type in to leave a comment, but you have to first click BELOW this LONG TOOLBAR in order to type anything. I’ve had people call me and ask what’s up with that? They thought the comment box wasn’t working because, if you put your cursor TO THE RIGHT of the toolbar, you can’t type. You haveto go all the way to the bottom of the TOOLBAR. Yes, I’m a rookie, and having a difficult time finding out simple things like this. I went into Mantra Settings and there is a lot you can HIDE/SHOW, but not this TOOLBAR. Please help me!

How can I prevent front end content from going behind the WordPress Admin Bar?

I am using a theme that has a sticky menu that always keeps the main navigation on the top of the display. Instead of positioning itself below the WordPress Admin Bar the theme’s main navigation menu is always behind it.

Hey guys, is there a way to remove the “floating” properties so that the bar does appear on the frontend, but doesn’t float? It bugs me when using other floating properties like your Floating Social Bar plugin.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Notify me of followup comments via e-mail. You can also subscribe without commenting.

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).