How To Hide The Admin Bar In WordPress

Must Read

7Caps Free On-Screen Caps Lock Indicator Review

Many laptops and keyboards don't come with an indicator for your caps lock key. Num Lock is...

Are Lithium-Ion Batteries Recyclable?

Electric vehicles are growing every day, and they are certainly going to be the future of automotive...

NASA demonstrates its first all-electric aircraft

NASA has demonstrated it's first all-electric experimental which they have dubbed as the X-57 Maxwell. Its first...
Scott Hartleyhttps://www.sertmedia.com
My name is Scott Hartley I am from Nashville, TN, and love to cover topics related to the latest tech trends, social media, and cars!

The WordPress admin bar is a very handy and useful feature it allows you to easily edit front end content, or access certain plugins functions quickly. That being said it can also be an eyesore, it slows down the website and if you are only ever in the back end why do you want it enabled all the time?

There are a number of ways to remove the admin bar but the easiest is to simply add this code snippet to your functions.php file (of a child theme) or a site specific plugin so it won’t display on your front end anymore.

add_filter('show_admin_bar', '__return_false');

Now there are some cases where you don’t want to show it for your subscribers, and other logged in users but you as the administrator still want to be able to access it. The following snippet will only show it for admin users.

add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
  }
}

Now you can quickly and effectively disable the admin bar based for everyone or just the non-administrative staff on your WordPress website!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest News

7Caps Free On-Screen Caps Lock Indicator Review

Many laptops and keyboards don't come with an indicator for your caps lock key. Num Lock is...

Are Lithium-Ion Batteries Recyclable?

Electric vehicles are growing every day, and they are certainly going to be the future of automotive technology. However, the cars are...

NASA demonstrates its first all-electric aircraft

NASA has demonstrated it's first all-electric experimental which they have dubbed as the X-57 Maxwell. Its first test flight is going to...

Tesla to launch version three of solar roof tiles on October 25, 2019

Tesla is going to launch a new version of its solar roof tiles line up tomorrow October 25, 2019.

Huawei VR Glass Will Launch This December In China

Huawei will finally be launching its own virtuality reality headset. The device has been dubbed the Huawei VR Glass. This has been...

More Articles Like This