Can’t really get to the bottom of this issue. I’m running a WordPress news website on a Debian WHM / Cpanel server. The server runs nginx and I am using redis for the website’s cache. I am also using the nginx helper plugin for WordPress.
The problem is that the WordPress Admin bar keeps appearing to visitors, even visitors who never logged in on the website. They can’t really go inside the site’s admin panel as if they click on a link in the WordPress Admin bar they are being asked for a username and password but this is still disturbing.
Any one of you experienced this before and know of a way to fix it ?
2
Answers
for display admin bar to all users you have to install this plugin
Try this link
and also try this code
i have not check this code yet but i used This-Link for reference purpose.
You are caching html version of the site. I have been facing this issue for so long. This can be so frustrating, I know.
Problem: When site cache is cleared and you are logged in as admin so the caching system will cache the page from a logged in user/admin. Which means they will cache the admin bar as well.
Solution: There are some ways you can try but the best possible way it to add this code
function.php
to hide admin bar and only show it on pages where needed with adding a stringshow=true
to URL E.g.https://www.example.com/?show
Or For short Install this plugin