The admin bar is appearing for non logged-in users on one of my sites, but only for two specific pages (/work and /contact, for what it’s worth). Has anyone heard of this happening before? It appears as though one of the site’s users is logged in (their username is displayed), but clicking any links on the admin bar lead to the login page. If I click Log Out under that users name in the admin bar, I get a prompt to ensure I want to logout, then a redirect to /wp-login.php. However, upon returning to /work or /contact, the admin bar still appears.
Leave a Reply
You must be logged in to post a comment.
Since I think that mis-identifying all users not-logged in is extremely unlikely, my line of thought is that wrong non-public version of page was cached for some reason.
I had the same problem and found that clearing the cache tempoparily solved it…
I started suspecting w3 Total cache and found this answer: https://www.thewebmaster.com/dev/2015/may/6/wordpress-admin-bar-shows-logged-out/
In short go to W3 Total Cache/Page Cache settings and make sure “Don’t cache pages for logged in users” is ticked. Otherwise it will cache the page as the logged-in user sees it.