Tutorial Example

Hide WordPress Admin Bar with a Line PHP Code – WordPress Tutorial

If you have logged into wordpress admin dashboard, wordpress will display an admin bar on the top of your site. In this tutorial, we will use a line php code to hide it.

WordPress admin bar

WordPress admin bar looks like:

If you plan to hide it, we can do like this:

Open your wordpress theme function, then copy and save code below:

show_admin_bar(false);

Then you will find the admin bar is gone.

However, we should notice this method can not hide the admin bar in admin dashboard page.

The admin bar is also displayed in administrator pages.