1

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.

  • Page got cached by something? – Rarst Mar 29 '11 at 21:59
  • Huh. Emptying all caches in W3 Total Cache fixed it. Add as an answer and I'll accept. Seems like an issue with that plugin that should be fixed. – Travis Northcutt Mar 29 '11 at 22:03
  • Change line 213 of admin-bar.php in the wp-includes folder from return to die. – user24289 Dec 1 '12 at 0:16
2

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.