WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» What Everybody Ought to Know about the WordPress Admin Bar

What Everybody Ought to Know about the WordPress Admin Bar

Last updated on January 18th, 2018 by Editorial Staff
17 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
What Everybody Ought to Know about the WordPress Admin Bar

WordPress comes with an admin bar that displays handy shortcuts for logged in users. This gives you quick access to admin tasks even when viewing your website’s front-end. In this article, we will explain what is the WordPress admin bar, and how you can utilize or customize it to your own needs.

What you need to know about WordPress admin bar

What is WordPress Admin Bar?

WordPress admin bar is a floating bar displayed for logged in users. It contains links to different admin screens, which allows logged in users to quickly switch to admin area when viewing the website.

WordPress admin bar

The admin bar is displayed for all users inside the admin area. Individual users can hide the admin bar when viewing the website by editing their user profile.

Show or hide admin bar when viewing website

The items displayed in the WordPress admin bar change based on user role and permissions. For example, users with administrator role see different items in the menu bar than users with editor role and so on.

Show or Hide Items in WordPress Admin Bar

Just like everything else in WordPress, the Admin bar is fully customizable via custom code or plugins. Some plugins already take advantage of this feature by adding their own menus in the admin bar.

Plugins adding their own items in admin bar

To take control of the admin bar, first you will need to install and activate the Adminimize plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, go to Settings » Adminimize page and look for Admin Bar Backend Options and Admin Bar Front End Options tabs.

Admin bar options

Clicking on each of them will take you to the admin bar options where you can select which items to display in WordPress admin bar. You can also choose items visible to each user role.

Show or hide items from WordPress admin bar

Don’t forget to click on ‘Update options’ button to save your changes.

Adminimize is a powerful plugin and allows you to change not just the admin bar but any admin screen on your WordPress site. To learn more, see our guide on how to hide unnecessary items from WordPress admin with Adminimize

Add Custom Links to WordPress Admin Bar

The purpose of the WordPress admin bar is to provide quick shortcuts to different admin screens. You can further customize it by adding your own custom links to the admin bar.

For this, you will need to add custom code to your WordPress files. If you haven’t done this before, then take a look at our guide on how to copy and paste code in WordPress.

First you need to add this code to your theme’s functions.php file or a site-specific plugin.

// add a link to the WP Toolbar
function wpb_custom_toolbar_link($wp_admin_bar) {
    $args = array(
        'id' => 'wpbeginner',
        'title' => 'Search WPBeginner', 
        'href' => 'https://www.google.com:443/cse/publicurl?cx=014650714884974928014:oga60h37xim', 
        'meta' => array(
            'class' => 'wpbeginner', 
            'title' => 'Search WPBeginner Tutorials'
            )
    );
    $wp_admin_bar->add_node($args);
}
add_action('admin_bar_menu', 'wpb_custom_toolbar_link', 999);

In this code, we have added a link to Google that searches WPBeginner. You need to replace ID, title, and href values with your own.

Adding custom link to WordPress admin bar

For more details, see our guide on how to easily add custom links to your WordPress admin bar.

Disable Admin Bar for All Users Except Administrators

Admin bar is highly useful for site administrators, editors, and authors. However, it is not very useful if you are running a WordPress membership website or just require users to login for certain tasks.

In that case, you may want to disable the admin bar for all users except site administrators. You will need to add the following code to your theme’s functions.php file or a site-specific plugin.


add_action('after_setup_theme', 'wpb_remove_admin_bar');
 
function wpb_remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

For more details see our article on how to disable WordPress admin bar for all users except administrators.

We hope this article helped you learn more about the WordPress admin bar. You may also want to see our ultimate step by step WordPress security guide to keep your WordPress admin area safe and secure.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

17 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

18 Comments

Leave a Reply
  1. Nilutpol says:
    Jul 2, 2020 at 4:30 pm

    Hi Sayed, Thanks for the Trick,it worked fine. But now I want to restore the admin bar because of some reasons and I couldn’t. I’ve removed the code but still not appearing bar. What to do ?

    Reply
    • WPBeginner Support says:
      Jul 7, 2020 at 11:13 am

      If the code was completely removed you would want to ensure you’ve cleared all caching on your site to prevent it from being a caching issue.

      Reply
  2. BaxAndrei says:
    Nov 21, 2014 at 11:26 am

    I have a problem, at me admin bar don’t have drop down effect.

    Reply
  3. Verna says:
    Dec 23, 2013 at 10:23 pm

    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!

    Reply
  4. John Galt says:
    Dec 12, 2013 at 11:36 pm

    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.

    Reply
    • WPBeginner Support says:
      Dec 13, 2013 at 7:46 pm

      John, you can disable admin bar on the front end by visiting Users » Your Profile and uncheck the box that says ‘Show toolbar when viewing site’. Also check out our guide on how to disable admin bar for all users except administrators.

      Reply
  5. Scott Buehler says:
    Nov 7, 2013 at 3:16 pm

    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.

    Reply
    • WPBeginner Support says:
      Nov 8, 2013 at 3:17 pm

      Add this code to your theme’s functions.php file or a site-specific plugin:

      function wpb_move_admin_bar() { ?>
      <style type="text/css">
      #wpadminbar {
      	position: absolute;
      	}
      </style>
      <?php }
      add_action( 'wp_head', 'wpb_move_admin_bar' );
      
      Reply
  6. Ian says:
    Oct 29, 2012 at 2:44 pm

    Is there a way to alphabetically sort the My Sites drop-down menu?

    Reply
    • Editorial Staff says:
      Nov 1, 2012 at 11:44 am

      Will look into it. Probably a filter for that.

      Reply
  7. bharatkumarvbk says:
    Jul 21, 2011 at 2:14 pm

    It is causing a trouble with ‘ wphead’ . And also hiding the logout link and dashboard header content

    Reply
  8. yoyowp says:
    May 2, 2011 at 11:10 pm

    How to make that admin bar to be a public bar? like buddypress one, when they are not logged in, that bar will just appear sign in and sign up link

    Reply
  9. candy says:
    Apr 12, 2011 at 7:10 am

    none of the tricks work for me anymore! no matter what I try I can’t get rid of that DAMN wordpress admin bar anymore!

    I now have the latest WP version 3.1 and it seems that all the tricks that worked before, including the ones you mention above DO NOT WORK ANYMORE!

    Looks like the WP developers are using dirty tricks to FORCE that stupid, useless top bar on us with any release!

    Why on Earth are otherwise such intelligent people and programmers waste their precious time & skills by developing and trying by any price to impose such a huge nonsense as this admin bar?!?

    Anyone managed to disable the devil bar in the latest WP version?

    Thanks!

    Reply
    • Editorial Staff says:
      Apr 12, 2011 at 7:46 am

      Yes, just tried all the tricks and they work.

      Reply
  10. Bertrand says:
    Mar 29, 2011 at 9:52 am

    Thanks! Finally was able to remove that damn gap on top of my website.

    From Quebec City

    Reply
  11. shyam jos says:
    Mar 19, 2011 at 11:00 am

    for me WP Admin Bar is a must and i love it..

    Reply
  12. Rajesh says:
    Mar 18, 2011 at 12:18 am

    Nice tips, great job! Thank u veru much :)

    Reply
  13. abdelhafid says:
    Mar 16, 2011 at 10:40 am

    awesome tips , thanks alot guys

    Reply

Leave a Reply Cancel reply

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.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
SeedProd Logo
SeedProd
Create beautiful custom landing pages - Drag & drop builder. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
Unbounce
Unbounce Coupon
Get 20% OFF on Unbounce landing page and conversion platform.
Advanced Coupons
Advanced WooCommerce Coupons
Get 50% off the Advanced Coupons smart coupons plugin for WooCommerce.
Featured In
About WPBeginner®

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).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.