How to Clear the Cache on Your WordPress Site

A lot of times your website will look funny or not work the way you expected because it’s loading something from cache.

Cache is just copies of webpages you’ve loaded on your device and they are kept there for a short time so that if you ever go back to that page it will make it feel like it’s loading fast.

These copies are automatically stored on your device or on the server your website lives on.

There are a few ways to check if the issue is because of cache.

1. Refresh the page a few times

I usually hold the Ctrl (or Cmd) key down and press the letter R twice real quick to force my page to reload on my computer.

(I’m not sure how to do that on a phone yet.)

2. Try a private window

The web browser on your device most likely has a way to view sites without relying on cache to load it.

In Chrome this is called Incognito mode.

Firefox has private browsing.

Safari has a Private Window.

Internet Explorer and Microsoft Edge call it InPrivate browsing.

Whatever browser you use should have a private window that lets you view a webpage as if you’re seeing it for the first time.

3. Clear the cache in WordPress

You might have a plugin turned on that’s keeping your files cached.

Look through your plugin list for any signs of the word “cache” and see if there’s a settings page with a button to clear the cache.

Sometimes there will also be a quicklink in the admin bar at the top of your Dashboard that lets you clear the cache.

4. Clear the cache on your server

The next place to check is on your server.

I know for me there is something called Varnish on my server that keeps files cached and there’s a settings page that lets me purge the cache when I need to.

When I’m developing a new site I always make sure this is turned off.

Cache is really annoying when you’re developing a site.

5. Clear the cache in your CDN

There’s also a chance that your site might be using a CDN (content delivery network).

This is a way to get copies of your site files saved to multiple servers around the world so when someone tries to view it they will get the closest copy of the file and it won’t take forever to load.

I use a CDN called Cloudflare and they have a way to clear the cache on their settings page.

[Bonus] Try adding a URL parameter

This might be the easiest and quickest way to view a fresh copy of your page, but it’s also the geekiest.

If you go to the top of your browser where the website URL is (you know that thing that starts with https:// and ends with .com) and put a question mark with a random word, an equal sign and then something random after that it will load a new copy of the page.

For example..

https://wpwaco.com/

https://wpwaco.com/?refresh=857

Now if there’s already a question mark, then you just need to put an ampersand sign and then your random word equals random word.

Like so..

https://wpwaco.com/?p=617

https://wpwaco.com/?p=617&refresh=908

Like I said, it’s a little geeky and doesn’t make sense to most people, but it’s a trick I use all the time before I go hunt down all the places that store cache for my website.

Just remember though, when you load this page with the URL parameter, you’ll need to change it to something different to load another fresh copy of the page.

I usually just add another number to the end.

It’s not uncommon to see my link end up like this..

https://wpwaco.com/?refresh=111111111111111111111111111111111

And there you have it.

Those are all of the ways I know how to clear the cache on a WordPress site.