My HP

30th November, 2012 | Getting Started |

How To Disable the WordPress Admin Bar

Whilst the Admin Bar at the top of the page in WordPress can be convenient for some people, for others, such as designers, it can become a pain when trying to view the site whilst logged in.

In this guide we will show you a couple of different ways of disabling the Admin Bar. Please also use the links below to skip to a section if you have a preferred option

Disable the WordPress Admin Bar on a per user basisDisable the WordPress Admin Bar site-wide via your theme functions.php file

Disable the WordPress Admin Bar on a per user basis:

Firstly you will need to log in your WordPress admin area / dashboard - This will normally be at a URL such as mydomain.com/wp-admin  (replacing mydomain.com with your own domain name)

Once logged in, hover over 'Users' on the left menu, then click on the 'Your Profile' option.

Note: If you are looking to disable this for a different user, hover over 'Users' on the left menu, then click on the 'All Users' option, and then edit the required user profile.

On your WordPress profile page, un-tick the 'Show Toolbar when viewing site' option

Then click on 'Update Profile' At the bottom of the page, to save changes.

The black admin toolbar will no longer show at the top of the page when viewing the site (when logged in as your user).


Disable the WordPress Admin Bar site-wide via your theme functions.php file:

You can also disable the WordPress admin bar for all users, by adding a small piece of code in to your themes function.php file.

Note: Where possible we would recommend adding this to the functions.php file via a child theme. If you add this to your main themes function.php file the code will be removed if you update the theme in the future.

Firstly you will need to log in your WordPress admin area / dashboard - This will normally be at a URL such as mydomain.com/wp-admin  (replacing mydomain.com with your own domain name)

Once logged in, hover over 'Appearance' on the left menu, then click on the 'Theme Editor' option.


On the Theme Editor page, find the 'Theme Functions (functions.php)' File from the right hand file list and click on it to open that in the editor.

Next, Scroll to the bottom of the functions.php file, and add in the following code:

/* Disable The WordPress Admin Bar for all users */
show_admin_bar(false);

Once done, click on 'Update File' to save changes.

The black admin toolbar will now no longer show at the top of the page when viewing the site and logged in.

Note: You can also update your functions.php file via the file manager of your cPanel hosting, or via FTP.

Comments