WordPress : How to solve missing Admin Bar / Toolbar at the top of the page

Wordpress missing admin bar or toolbar thumbnail

If you were making changes to the WordPress site theme and the admin bar (also known as a toolbar) suddenly disappeared, you are not alone. This happened to me too. I noticed that the admin bar at the top of the page was missing on the front-end after making some changes on my theme. The admin panel was still accessible through /wp-admin/ path and inside the dashboard, the admin bar was not broken. In this post I will show you why this happens and how to bring it back.

This is how that admin bar appeared on my site. It completely disappeared with empty space in its place.

Missing Admin Bar at the top of the page
Missing Admin Bar at the top of the page

First, I tried to identify what exactly caused this problem. I suspected it had to do with my recent template modifications so I temporarily switched to different theme to see what happens. And sure thing the admin bar was not blank and worked perfectly on that template. It turns out, there are quite a few causes of this issue.

Admin bar / Toolbar is disabled for the user

Let's tackle the easiest one first. One possibility is that the admin bar is turned off in your user profile.

Go to Dashboard > Users > Your Profile and under Toolbar option, "Show Toolbar when viewing site" should be checked as shown below:

WordPress missing admin bar - toolbar option in user profile

If the Toolbar is selected, then it is most likely that the culprit is located in the template files. The following solutions will require template modification by going to Dashboard > Appearance > Editor.

Admin bar is turned off in functions.php

This possibility can also be easily checked. Open functions.php and look for either show_admin_bar() function or show_admin_bar filter. The false parameter will disable admin bar.

For example, free WordPress theme HTML5 Blank does exactly that with the following code inside functions.php:

// Remove Admin bar
function remove_admin_bar()
{
    return false;
}
add_filter('show_admin_bar', 'remove_admin_bar');

Commenting off those lines of code solves the problem.

Missing wp_footer function

Before the ending </body> tag, a call to the wp_footer function should be made. So find the templates with </body> tag and check if wp_footer function is present. Usually the only template to check for this is the footer template footer.php, but this is not always the case. Some template files might have their own </body> tag and they should also contain wp_footer function before that tag. The code should look something like this:

<?php wp_footer(); ?>
</body>
</html>
Note: Missing wp_footer() can also break plugins, so if some plugins are also not working correctly, this might be the cause.

Missing get_footer function

If you found wp_footer() before </body> tag inside footer.php, then maybe the template files never include the footer.php and as such, the footer doesn't get rendered. The footer is rendered when a call to get_footer() function is made. Usually, a lot of template files include a footer, so try to determine, which template is causing the problem. For example, if the admin bar is missing in pages, but not in posts, look into a page template page.php, if the problem is with posts, inspect single.php. If you are not familiar with the WordPress templates, check WordPress Template Hierarchy for more information.

When the problematic template is located, look at the end of the file as this is where call to the footer should be made:

<?php get_footer(); ?>
Note:Not all template files need get_footer(). For example, sidebar.php is shown, when other templates call get_sidebar(). In that case, the sidebar.php shouldn't have get_footer at the end of the template.

PHP Syntax Error

If you located both the get_footer() and wp_footer() functions, then there is a possibility that the code execution stopped due to some PHP syntax error and it never reached either of the functions. Turning on debugging can help you identify the problem. Locate the following line inside wp-config.php file and set it to true.

define('WP_DEBUG', false);
Note: For live websites, you should turn off debugging by setting it back to false when you are done!!!!

Instead of turning on debugging, you can alternatively check for PHP errors by temporarily putting echo statements inside templates to test where the execution of the code stops.

The culprit of my problems was the last case. There have been PHP errors just before the get_footer call, so the whole template was generated, but the last few lines of code were never executed.

Issue with the Plugin

The plugins can also be a cause of the missing admin bar. For example, one commentator had an issue with the social sharing plugin. If you suspect a plugin, temporarily disable it to check if it is the cause of this issue.

Conclusion

When we customize our template files, missing admin bar / toolbar in WordPress might occur due to various reasons. In this article, we listed quite a few of them, the most common are when the call to either wp_footer or get_footer is missing in the template(s).

I hope this post will help others in similar situations. If you are aware of some other way that causes this problem, let me know and I will add it to the list.

This article was first published in 2013 and has since then been updated and republished.

43 Comments

Click HERE to add your Comment
  1. Nishant Thakur
    January 14, 2014
  2. Emina
    April 14, 2015
  3. HS
    September 20, 2016
  4. Vinay Grover
    October 3, 2016
  5. ramin
    December 7, 2016
  6. Webby
    March 28, 2017
    • Dom
      April 21, 2017
      • admin
        April 22, 2017
  7. Fernando Santos
    May 17, 2017
    • Briar
      January 14, 2018
    • Penny
      May 21, 2018
    • jay
      September 19, 2018
    • Holly
      June 28, 2019
    • James
      November 14, 2019
    • KT
      January 17, 2021
  8. Eugen
    June 29, 2017
  9. peel
    July 24, 2017
  10. peel
    July 25, 2017
    • admin
      July 25, 2017
  11. Sruthi N
    November 8, 2017
    • admin
      November 9, 2017
  12. joe
    January 21, 2018
    • joe
      January 21, 2018
      • joe
        January 23, 2018
  13. syl
    February 13, 2018
    • admin
      February 13, 2018
      • syl
        February 13, 2018
  14. David Steenkamp
    March 1, 2018
  15. Sarah Lewis
    May 9, 2018
  16. Peter Raymond
    October 31, 2018
  17. Adams
    September 19, 2019
  18. Sagar Mishra
    September 29, 2019
  19. raja
    October 1, 2019
    • admin
      October 1, 2019
      • Pedro Santos
        December 12, 2020
  20. Octiv Digital
    October 30, 2019
    • admin
      October 31, 2019
  21. Keith
    March 7, 2020
  22. Craig Coggle
    March 30, 2020
  23. rajesh
    April 21, 2020
  24. Acdtpv
    August 10, 2020
  25. Michael Yuen
    January 5, 2021
  26. Evelyn Richardson
    September 16, 2021

Write a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.