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.
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:
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>
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(); ?>
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);
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.
Nishant Thakur
January 14, 2014What an awesome post!
I had installed Admin Bar Disabler plugin to deacitvate my WordPress admin bar and when I deactivated and removedthat plugin, my admin bar was disappereed.
I was confused.How did this happen?
Then, thank god I got your amazing post which helped me in solving my problem.
My wp_footer function was missing.Actually,that admin bar disabler plugin deleted my wp_footer function I guess.
Emina
April 14, 2015Had the same problem, tried a lot of suggestions, but then I found out there was a white line in the header. Removing the white line did the job.
HS
September 20, 2016Thank you - I removed from my footer template in error and the admin bar disappeared when viewing pages. Inserting it again where you indicated solved the problem!
Vinay Grover
October 3, 2016I was Also Facing The Same Problem but your Post Really helped me.
ramin
December 7, 2016Very good,
Thanks.
Webby
March 28, 2017Similar issue except I am only missing the admin bar and in page links on one page only... worked one day then not...
Dom
April 21, 2017I am having a very similar issue. The tool bar works on almost all pages except two. It was working this morning and no changes were made to the Theme or to any plugins.
admin
April 22, 2017Hi,
I would suggest to check how the source code of the generated HTML of those two pages end. I would assume they end abruptly, so it might give you the clue where the problem lies.
Fernando Santos
May 17, 2017If nothing mentioned in the post works, try changing the WordPress Address (URL) and the Site Address (URL) at Settings > General by adding or removing the www to them.
If it works, you can switch it back then.
Worked for me!
Briar
January 14, 2018I am a total beginner at all of this, and your comment saved the day! Thank you.
Penny
May 21, 2018Worked for me too, thank you! My bar disappeared after a cookie clearance and so was driving me nuts because I knew it wasn't a change to the template - but this fixed it, go figure.
jay
September 19, 2018Thanks man. It worked.
Holly
June 28, 2019yes! That worked for me! I was ready to pull my hair out with all the other suggestions not working.
James
November 14, 2019tried so many of the other solutions but THIS WORKED!!! Thank you!!
KT
January 17, 2021Thank you!! This helped so much, and such a simple fix. Thank you!
Eugen
June 29, 2017I located my problem in a plugin. When disabled, admin toolbar is showing.
peel
July 24, 2017Hi guys,
I tried the all suggested solutions despite of it the admin bar is not appeared on my site. Very weird because it works well with explorer but doesn't work with chrome and firefox. I use the newest WP, newest Divi like template, moreover i turned off every single plugins. Did somebody experience similar issue?
peel
July 25, 2017Hi, i found the solution. My WordPress url was
http://mysite.hu
instead ofhttp://www....
It seems, the Internet Explorer can accept this, while Firefox and Chrome cannot.admin
July 25, 2017Thank you for sharing your solution, so it can help other people with similar issue.
Sruthi N
November 8, 2017I have a different problem, I have a problem only after opening any single post.
Home page is fine, and admin bar is also fine in home page and all other pages.
Only when I open any post, I can't see admin bar, sidebar, footer.. nothing. I already checked single.php file with other sites. Not able to figure out the problem. Can you suggest any other solution to my problem?
admin
November 9, 2017The single.php usually has this code at the end of the file:
get_sidebar();
get_footer();
Try commenting out
get_sidebar()
and check if the footer appears. One possibility is that the sidebar.php template has some error in it, so the code execution stops there and never reachesget_footer()
.joe
January 21, 2018Same issue. Well almost. I actually did update my theme. Everything was fine until I edited a page, lost the admin bar on only the two pages that were edited. If I go to preview the page, the admin bar shows up but won't allow me to make changes in preview mode. If I get rid of the preview text in the address bar and just load the actual page the admin bar goes away again. Thought I'd share the details as it seems like a specific cause. I've tried all other methods mentioned and although popular, am starting to think it is a poorly coded theme as I'm getting random errors here and there but am able to go back and fix it.
joe
January 21, 2018So I made some progress. I noticed a couple days ago when I created the page that the ending url was /home-NEW-edit. Noticed but didn't pay much attention to the capitalization. I'm remaking my home page and just added some random text to the word home in order to distinguish between the current home page and this new one. Since then I've been loading the page differently I guess. Sometimes with /home-new-edit notice the capitalization on the word 'new'). The web browser will still go to the page no matter what the url capitalization is, but the page will not recognize you as the admin if the capitalization is off. So in my case /home-NEW-edit shows the admin bar, and the other mentioned way will not. Hopefully this helps others having the same issue.
joe
January 23, 2018Kept running into the issue randomly. The only way I found a temporary fix is to change the url name when the admin bar goes away. Go to 'Pages' view the page in question. Then change the address link of the page. So if the page missing the admin bar is 'http://test.com/hello', change it to 'http://test.com/hello1'. Then save it and load that new page in the address bar. That should bring back the admin bar to that page. When the issue occurs again just change it to '.../hello2' and so on. When you're ready to publish the page change it back to the original link you intend to keep it as. Seems like a browser cache issue but even after clearing all website data including cache I didn't get any results. The method mentioned above is the only thing working for me at this time.
syl
February 13, 2018I only have this issue on Chrome and I cant say why. I tried all your solutions but my codes are fine - I dont think it would work on Firefox, if they werent. So this is a Chrome issue for me and I've no idea what else to try, heh 😀
admin
February 13, 2018Have you tried to clear the cache and cookies?
syl
February 13, 2018I have indeed! after many more trying around however, I have been able to fix this. I deactivated all my plugins and I also logged out and back into WP deleting saved credentials. Also made sure allowing third party cookies was accepted in chrome settings. So far the bar has stayed visible, so I'll try and find out which plugin it was!
David Steenkamp
March 1, 2018Thanks for posting this - realizing that I had to search for "admin_bar" within all the theme files helped me find the culprit - using a discontinued theme (Canvas - by WooCommerce) - turns out it was just a theme option that someone had checked off! Turned it back on and all good now. Thanks for the great post!
Sarah Lewis
May 9, 2018Adding yet another cause... in my case, most pages were showing the admin bar as expected, but one page was not. Eventually, I realized that I was accessing most of them with a secure version of the URL (https:// at the beginning) but the problem page wasn't using a secure URL (it was just http:// at the beginning). Using the secure version brought the admin bar back.
This probably won't be relevant in most cases (usually, if you're using SSL, all of the pages should be using it) but it's worth sharing as a weird edge case in hopes that some future googler finds their answer!
Peter Raymond
October 31, 2018Thank you for this article it saved me a headache,,,,
Adams
September 19, 2019Thanks, it worked. I removed from function.php
/** add_filter('show_admin_bar', '__return_false');*/
Sagar Mishra
September 29, 2019Mine was missing get_footer();
Thanks for the solution.
raja
October 1, 2019My admin bar not showing for other users like Editor, Contributor, and for the author as well and when i switch any of these user to an Administrator, Admin bar start to appear.
Please help me non of your suggestions working in my case I have tried all of these.
My admin bar not showing for other user except administrator.
admin
October 1, 2019Hi,
This looks to me that either your theme has a code that hides the admin bar for non-admin user roles or you have some plugin enabled that deals with the visibility of the admin bar.
If your issue is due to a theme, try to find the code (usually in functions.php) that might look something like this:
if ( !is_admin()) {
show_admin_bar(false);
}
Pedro Santos
December 12, 2020Thank You So Much .. this was that i did:
Opened functions.php, and in the end just added:
if ( !is_admin()) {
show_admin_bar(true);
}
Saved, refreshed page, and everything is working again.
Octiv Digital
October 30, 2019Is there any update for this post? I'm having this issue on a site and have checked all of the obvious files. I haven't updated the theme or any plugins, but the WP toolbar is just gone.
admin
October 31, 2019So, the Toolbar worked fine until it went missing without you doing any theme and plugin update?
Have you tried running the website in browser private window? Maybe some browser addon / extension is causing this issue.
Keith
March 7, 2020Another reason.
On WordPress' General Settings page, the WordPress Address (URL) and the Site Address (URL) are different, even subtlety different.
For example, one has a www at the front, and one doesn't; or one has a http:// at the start, the other a https://
Craig Coggle
March 30, 2020Yes... totally worked, thanks! Whenever I created new client users the toolbar view checkbox was unchecked by default.
rajesh
April 21, 2020thank you so much for this article.
Acdtpv
August 10, 2020Excellent, now my admin bar shows. Reinserted wp footer. Thanks, nice post.
Michael Yuen
January 5, 2021For me, the issue was the admin toolbar not showing on the home page, but did for individual posts. When I went to check My Profile (or go to the Dashboard) and back to Visit Site, the home page now showed the toolbar.
Turns out, I had to log out and back in. The toolbar now showed again on the home page without having to first go to the Dashboard > Visit Site. My theory is that my WP login token expired after 30 days (am using Wordfence plugin's 2FA), and because I always logged in using my Nextgen Social Media logins (ie. Google), the Wordfence 2FA token never got refreshed. This conflict in my login state likely caused the admin toolbar to disappear from the home page until I navigated to a page that showed the toolbar.
Evelyn Richardson
September 16, 2021I have been looking for a solution to this problem for many days but I have not been able to solve it. But today I have solved up many problems after this article of yours. This article will prove to be very useful for beginners.
Anyway, thank you very much.