On this page
What this issue is
Most content management systems add extra HTML when you are logged in. In WordPress this is the black admin bar at the top, plus "Edit page" links. Shopify themes, Webflow and others have similar preview or editor bars. This extra HTML should only ever reach you.
A cache is a layer that stores a finished copy of a page and serves it to many people. If the cache stores the copy built for you, it hands that copy to everyone. The cache can be a plugin, your host's server cache, or a CDN (content delivery network) such as Cloudflare.
Why it costs you leads or sales
The impact is medium, but it is easy to miss because you rarely see your own site logged out. Visitors see a site that looks broken or unprofessional, which lowers trust at the exact moment they decide to enquire or buy.
- A black admin bar or toolbar across the top of the page, which can push the header down or overlap a sticky menu
- Edit, Customize or Dashboard links that lead to a login screen
- Layout shifts or a hidden header, so a call-to-action button sits out of place
- Private details in the page source, such as your username, nonces or draft notices
- Extra scripts loaded only for admins, which can slow the page or throw errors
- You load the page logged inThe page includes the admin bar
- Cache stores that copyLogged-in cookie is ignored
- Visitor requests the pageGets the cached admin copy
- Visitor sees a broken-looking pageTrust drops, CTA may be displaced
One logged-in request poisons the cache for everyone after it.
How to check if your site has it
Open a private window
Use an incognito or private window where you are not logged in, then load the affected page.
Look for admin elements
Check the top of the page for a toolbar and for Edit links. Right-click and choose View source, then search for admin-bar or wpadminbar.
Test from another device
Load the page on your phone using mobile data. This avoids your own browser and office network.
Read the cache headers
In browser developer tools, open the Network tab, click the page request and look at the response headers. Values such as cf-cache-status: HIT, x-cache: HIT or age show a cached copy was served.
Check several URLs
Test the home page, a key landing page and a form page. Only some URLs may be affected.
curl -s https://www.example.com/ | grep -i -E 'wpadminbar|admin-bar'
curl -sI https://www.example.com/ | grep -i -E 'cache|age|set-cookie'If the first command prints any lines, the public copy contains the admin bar. Replace the example address with your own.
How to fix it
The cause is almost always a cache rule that ignores the logged-in cookie, or a cache that was warmed while you were logged in. Fix the rule, then purge. Purging first without fixing the rule lets it happen again.
Exclude logged-in users in your cache plugin
Most plugins (WP Rocket, W3 Total Cache, LiteSpeed Cache, WP Super Cache) skip caching for logged-in users by default. Open the plugin's cache settings and make sure the option for logged-in users is not set to cache them. The exact menu name differs by plugin.
Check the host cache
Managed hosts often run a server cache too. Look in your host's dashboard or the host's plugin for a cache exclusion list and confirm the wordpress_logged_in cookie is excluded.
Purge all caches
Clear the plugin cache, the host cache and the CDN cache, in that order.
Bypass the cache when a session cookie exists
In your reverse proxy or cache config, skip caching when the login cookie is present. Example for nginx FastCGI cache is shown below.
Or mark logged-in responses as private
Send Cache-Control: private, no-store on any response that contains user-specific HTML so shared caches never store it.
Purge and retest
Clear the proxy cache, then test with curl as shown earlier.
Know the limit
Tag Manager does not control page caching, so it cannot fix this. Use it only if a tag you added shows an admin-only element. Otherwise fix the cache on the CMS, host or CDN.
set $skip_cache 0;
if ($http_cookie ~* "wordpress_logged_in|comment_author|wp-postpass") {
set $skip_cache 1;
}
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;Find any Cache Everything rule
In Cloudflare, open Caching, then Cache Rules (or Page Rules on older setups). A rule that caches HTML for all requests is the usual cause.
Add a bypass for the login cookie
Create a rule placed before the cache rule: if the Cookie header contains wordpress_logged_in or wp-, set the cache to Bypass. Also bypass /wp-admin and /wp-login.php.
Purge the CDN cache
Use Purge Cache, then Purge Everything, or purge the affected URLs.
Log out when warming caches
If you run a cache preload or warm-up, make sure it runs without your login cookie.
How to confirm it's fixed
- Load the page in a private window and confirm no toolbar or edit links appear
- Run the curl grep command and confirm it prints nothing
- Reload twice so you are sure you are seeing a cached copy (header shows HIT), and confirm it is still clean
- Log in, load the page and confirm you still see the admin bar (you should)
- Test the home page, key landing pages and form pages
Before
- Admin bar visible to everyone
- Edit links lead to a login screen
- Header may be pushed down
After
- Clean page for visitors
- Admin bar only for logged-in users
- Cache bypassed on the login cookie
How to prevent it happening again
- After any cache or CDN rule change, test the page in a private window
- Never use a Cache Everything rule on HTML without a cookie bypass above it
- Keep preload and warm-up jobs logged out
- Check the page logged out after theme, plugin and host changes
- Write down every caching layer your site uses and who controls it
How FunnelGuard handles this
FunnelGuard does not check for this yet. It is a possible future check. Today FunnelGuard does not look for an admin bar or logged-in elements in the public page.
What it does cover nearby: a robot visitor runs your real journeys, such as lead forms and checkouts, on a schedule. It checks each step, so if a displaced header or a broken layout stops a button or form from working, the journey fails, is re-checked from a second region, and you get an alert with a screenshot. That only catches cases where the admin view breaks a step, not a cosmetic bar.
To watch for it yourself, add a recurring reminder to open your top pages in a private window after each release, or use any uptime or content monitor that can alert when the text wpadminbar appears in a page's HTML.
Questions people ask
Why is the WordPress admin bar showing to visitors?
A cache stored the page while you were logged in and now serves that copy to everyone. This usually happens when a plugin, host cache or CDN rule ignores the logged-in cookie. Exclude logged-in users from caching and purge all caches.
How do I remove the admin bar from the cached page?
Fix the cache rule first, then purge the plugin cache, host cache and CDN cache. Reload the page in a private window to confirm the bar is gone. Purging without fixing the rule lets the problem return.
Does Cloudflare cache the WordPress admin bar?
It can, if you use a Cache Everything rule for HTML without a bypass for the login cookie. Add a Cache Rule that bypasses the cache when the Cookie header contains wordpress_logged_in, and bypass /wp-admin. Then purge the cache.
Is a cached admin bar a security risk?
It can be. Beyond the visible bar, the page source may expose your username, nonces or draft content. Treat it as a leak, fix the cache and purge everything promptly.
Why do I only see the admin bar when logged out on some pages?
Only pages cached while you were logged in carry it. Other pages were cached by a visitor or never cached. Test your key URLs and purge the affected ones.
How can I tell if a page is served from cache?
Open developer tools, go to the Network tab and check the response headers on the page request. Values like cf-cache-status: HIT, x-cache: HIT or an age header mean a cached copy was served.
Does FunnelGuard detect a cached admin bar?
No, FunnelGuard does not check for this yet. It does run your real journeys and alert you if a step such as a form or button fails. Use a private-window check or a content monitor for the admin bar itself.
Related issues
- OPS-108Cached page with another visitor's personal data/cartFix guide
- OPS-107CDN serving stale page after deployFix guide
- OPS-110Cached form nonce expired (form rejects submissions)Fix guide
- OPS-111Cache stripping UTM/gclid query paramsFix guide
- OPS-112Cache keyed without currency/language (wrong prices)Fix guide
- OPS-115CDN purges failing / edge outageFix guide