Cloudflare + WordPress cache issue (adminbar and loginpage shown)

So – wanted to remind myself of not doing this dumb error again.

You have the following:

  • A WordPress site
  • Cloudflare plugin
  • Pagerule setup in Cloudflare to cache ALL (All objects)

What happens?

I can see the adminbar even though Im not logged in. Also see admin comments and so on. What happens is that the Cache all rule messes things up. It caches the adminbar and serves it even though you are not logged in.

It does not mean the user has access! User comes to login screen when trying to enter. But it still looks unprofessional….

How to solve it

Tried to rewrite the rule – didnt work – Still had the cache

According to Cloudflare support the plugin should manage it automatically – but not when page rules are active. Disabled pagerules. No adminbar. But also slower.

Solved it by running a local cache plugin AND using the cloudflare RAILGUN option instead as my provider supported it. Similar speeds – no caching problem. Also removed images and what not that in essance are useless anyways. Dumped Cloudflare plugin.



Want to know more about me? If you want to ask anything, feel free to add me on Linkedin. This place is just for me to offload my notes - hope you find it useful.