Skip to content
HyperDAF editorialCaching

How to Clear WordPress Cache: Every Method That Works

“The prices are wrong!” That’s how the message started. It was 9:40 at night, and a store owner was about to lose it. She had updated every sale price for…

CachingEditor-curated guide
15 min12 sectionsIntermediate
Before you beginWhat this guide gives you
12Focused sections15Minutes to finishIntermediateExperience level143Article views
Start reading
Table of contents12

“The prices are wrong!” That’s how the message started. It was 9:40 at night, and a store owner was about to lose it. She had updated every sale price for a flash sale, the sale was live, and her customers were still seeing last week’s prices. She had refreshed the page twenty times. Nothing changed.

I have fixed this exact panic hundreds of times. My name is Ahmed Raza, and “my changes aren’t showing” is the most common emergency call in my working life.

Here’s what nobody tells you when you’re staring at a stale page: there isn’t one cache. There are six of them, stacked like layers of glass, and clearing only one leaves the others happily serving old content. Most people clear the wrong layer, conclude that “clearing the cache doesn’t work,” and start fearing the purge button like it might delete their website.

I understand the fear — breaking your live site at midnight is a genuine nightmare. But I’ll walk you through every cache layer in the exact top-down order I use on client sites weekly. If you’ve ever hit refresh until your finger hurt, this is for you. Let’s get started.

Clearing a cache never deletes your content. Not your posts, not your products, not your settings. All it does is throw away temporary saved copies and force fresh ones to be made. The worst that happens is your site runs a little slower for a minute while the cache rebuilds. That’s it.

Illustration of a broom sweeping a layered stack of web pages, symbolizing clearing the layers of WordPress cache.

In This Guide

  • What “Clear the Cache” Actually Means (the 6 Layers in Plain Words)
  • Step 0: Diagnose First — Which Layer Is Stale?
  • Method 1: The 10-Second Browser Hard Refresh
  • Method 2: Clear Your Caching Plugin’s Cache
  • Method 3: Purge Your CDN
  • Method 4: Flush the Object Cache
  • Method 5: The Hidden Layer — OPcache
  • The Purge-Top-Down Checklist (My Exact Order)
  • How to Verify It’s Really Cleared
  • FAQ and Final Thoughts

Ready? Let’s get started.

What “Clear the Cache” Actually Means (the 6 Layers in Plain Words)

The first time a client asked me to “just clear the cache,” I clicked one button, declared victory, and looked like an idiot when nothing changed. There was no single cache. There were layers, and I’d only touched one of them.

Caching means your site saves ready-made copies of things so it doesn’t rebuild them every time. Every saved copy is a cache, and every one of them can go stale. Here are the six layers that matter.

1. Browser cache — saved copies on your own computer or phone. Your browser keeps images, stylesheets, and pages so sites load faster on repeat visits. It’s the only layer a keyboard shortcut can fix, and it’s the culprit more often than people admit.

2. Page cache (your caching plugin) — saved finished HTML pages on your server. This is the layer most tutorials mean by “the cache.” If page caching still confuses you, I wrote a plain-English breakdown in page caching explained for WordPress.

3. CDN cache — saved copies on servers around the world. Visitors load from the nearest edge server, and those edge copies have their own lifetimes — no purge on your server touches them.

4. Object cache — saved answers to database questions. It remembers answers to questions WordPress asks the database constantly. When it goes stale, you get half-old pages: fresh content beside outdated widgets or menus.

5. OPcache — saved compiled PHP code. It keeps compiled PHP in memory. If your host disables timestamp checks for extra speed, code edits won’t apply until OPcache is reset — no page-cache purge will help.

6. Server-level cache (your host’s own) — Some hosts run their own page cache — purge it alongside your plugin’s cache if yours does.

A visitor’s request flows through these layers from the top down — which is exactly the order I purge them in. Next: the step most people skip, and the one that saves the most time — figuring out which layer is stale before you touch anything.

Step 0: Diagnose First — Which Layer Is Stale?

I once purged everything on a client’s site three times before realizing the problem was his own browser. Twenty minutes of server-side purging, fixed by a keyboard shortcut. It takes two minutes.

Magnifying glass over a diagnostic checklist, showing how to identify which WordPress cache layer is stale.

The incognito window test. Open a private/incognito window and load the page. New content there? Your normal browser cache is stale — jump to Method 1. Still stale? The problem lives upstream.

The second-device test. Check the page on your phone with Wi-Fi off, or ask a friend to look. Fresh for them but stale for you? Your browser or local network is caching. Stale for everyone? It’s your server or your CDN.

The logged-in test. View the page logged in, then logged out (or in incognito). Fresh when logged in, stale when logged out? That’s the fingerprint of a stale page cache — most setups bypass the cache for logged-in users, so admins see the truth while visitors see the old copy.

The code-edit test. You edited a PHP file and nothing changed, though the file on the server is correct? That’s OPcache. Page purges will never fix it. Skip to Method 5.

The fragment test. The page is fresh but pieces are old — a widget with an old phone number, a menu missing a new item? That’s the object cache holding old database answers. Method 4 is your fix.

Staleness wears other disguises too — broken layouts, login weirdness. I keep the full rogues’ gallery in why caching breaks your WordPress site and the fix.

Diagnosis done? Now we climb the ladder from the top, one rung at a time.

Method 1: The 10-Second Browser Hard Refresh

My very first “cache emergency” was fixed with a keyboard shortcut. I’d cleared the plugin cache twice before a colleague asked, “Did you try a hard refresh?” That shortcut has since rescued me more times than every other method combined.

Which symptom this fixes: you see old content, but everyone else sees the new stuff. Classic version: you changed your site’s styling and it looks broken — but only on your computer. That’s your browser using its saved copies of your CSS and images.

A normal refresh often gets answered with “I already have this, thanks.” A hard refresh forces a full re-download: Ctrl + F5 (or Ctrl + Shift + R) on Windows/Linux, Cmd + Shift + R on Mac. On mobile there’s no shortcut — clear the site’s data in browser settings, or open the page in a private/incognito tab, which always starts with an empty cache.

Browser window with circular refresh arrows, illustrating a hard refresh clearing the browser cache.

If the hard refresh fixed it, you’re done. If not, the staleness lives upstream — next rung: your CDN.

Method 2: Clear Your Caching Plugin’s Cache

This is the button most tutorials stop at — and why half their readers walk away disappointed. They clear the plugin cache, nothing changes, and they conclude the whole thing is broken. The plugin cache was never the problem; it was just the most famous layer.

Which symptom this fixes: logged-in you sees fresh content, but logged-out visitors see old pages. Or you updated a post and the public version didn’t change.

Your caching plugin saves fully-built HTML pages so visitors get served instantly. Purging deletes those saved pages — never your content, only the temporary copies — and the next visit rebuilds them fresh.

Where to purge: your caching plugin’s settings page has a button labeled Purge Cache, Clear Cache, or Empty Cache, usually on the main screen. Most also add a purge button to the WordPress admin bar — that’s the route I use daily.

Most plugins auto-purge when you update a post, but settings changes, widget edits, menu updates, and theme tweaks often don’t trigger it — purge manually after structural changes.

Don’t forget your host’s own cache. Some hosts run a separate server-level page cache — purge it in the same breath, since the layers stack.

After purging, check in an incognito window. Fresh? But if your site sits behind a CDN, visitors worldwide may still get old edge copies. That’s the next rung.

Method 3: Purge Your CDN

I once spent an hour purging a client’s plugin cache before learning his CDN was serving a week-old copy of the homepage. The plugin purge worked perfectly every time. The CDN was simply never asked.

Which symptom this fixes: changes appear for you but not for visitors on other networks or in other countries — or you purged everything on your server and the site still shows old content hours later. Server purges cannot reach edge servers. Only a CDN purge can.

Find your CDN dashboard. Log in to your CDN service and look for Purge Cache or Purge Everything. Not sure you use one? Ask your host — they’ll tell you in seconds.

Purge everything when in doubt. Single-file purge suits one stale image; full purge suits a mystery — it’s faster than guessing which file is stale. Then wait a minute or two for edge servers to drop their copies.

Use development mode while you work. Many CDNs offer a temporary bypass mode — turn it on while editing so you see every change instantly, off when you’re done.

Server rack with glowing layers being purged, representing CDN and server-side cache clearing.

A CDN also shapes how fast your server responds in the first place — once your cache behaves, the bigger speed picture is worth a look in how to reduce TTFB on WordPress.

Method 4: Flush the Object Cache (wp cache flush)

This is the layer that made me feel like a detective. A client’s sidebar widget showed the old phone number on every page. Pages were fresh, the CDN was purged, the plugin cache was empty — but that widget wouldn’t update. The page wasn’t the problem. The saved database answer was.

Which symptom this fixes: fragments of pages are stale while the page itself looks current — widgets with old content, menus missing new items, “recent posts” ignoring your latest post.

The object cache stores answers to questions WordPress asks the database constantly. The troublemaker is the persistent object cache — Redis or Memcached, usually set up by your host — which remembers answers across requests and can hold stale ones for a long time.

The WP-CLI way. If your host offers WP-CLI, flushing takes one command:

“bash wp cache flush “

One line drops every cached database answer. The official wp_cache_flush reference is short and worth a read.

One honest warning: on some setups, user sessions live in the object cache, so flushing can log users out. Harmless — they log back in — but do it during quiet hours, not at noon on sale day.

The no-command-line way. Some performance plugins include a Flush Object Cache button. No button and no WP-CLI? Your host’s support can flush it in under a minute.

One layer remains — the one almost no guide mentions, and the reason PHP code edits sometimes refuse to appear no matter how much you purge.

Method 5: The Hidden Layer — OPcache

The weirdest ticket of my career: a developer edited his theme’s functions file, refreshed, and nothing changed. We purged the plugin cache, the CDN, the object cache. The file on the server was correct — I read it myself. Yet the site behaved as if it were reading an old copy. Because it was. Just not from anywhere we’d looked.

Which symptom this fixes: PHP file edits don’t take effect. The file on disk is correct, but the site runs the old code. Page purges, CDN purges, and object-cache flushes all do nothing.

Here’s why: OPcache keeps PHP’s compiled scripts in memory to skip recompiling on every request. Normally PHP checks file timestamps and notices edits — but some hosts disable timestamp checking for extra speed. From that moment, code edits are invisible until OPcache resets. No cache plugin can fix this; the staleness lives inside PHP’s memory, below WordPress entirely.

How to reset it: look in your hosting panel for Flush OPcache, Clear PHP Cache, or Restart PHP. No button? Ask support — it takes seconds. Self-managed server? Restarting PHP-FPM clears it. Completely safe: OPcache rebuilds itself within seconds.

Related note: if updates left things genuinely broken — white screens, fatal errors — rather than merely stale, purging won’t save you. Work through what to do when a WordPress update breaks your site instead.

The Purge-Top-Down Checklist (My Exact Order)

Random purging wastes an hour and still shows old prices. Ordered purging fixes it in five minutes — top of the stack down, stopping the moment the problem is solved:

1. Hard refresh your browser — Ctrl+F5 or Cmd+Shift+R. Ten seconds, zero risk. 2. Purge your CDN cache — purge everything, wait a minute. 3. Purge your host’s server-level cache — the button in your hosting panel, if one exists. 4. Purge your caching plugin’s cache — admin-bar button or settings page. 5. Flush the object cache — wp cache flush (quiet hours for busy sites). 6. Reset OPcache — only when PHP code edits are involved. 7. Verify — the next section, every time, no exceptions.

Nine times out of ten, the problem dies at step 1, 2, or 4. The full run is for the stubborn cases. Bookmark this list — future-you, mid-panic at 9:40 at night, will be grateful.

How to Verify It’s Really Cleared

Hope is not a verification strategy. I verify every time — “I think it’s fixed” has embarrassed me in front of clients too often.

The incognito check. Open a private/incognito window — it starts with an empty cache, so what you see is what a first-time visitor sees. Change there? That’s your primary proof.

The second-network check. Look at the page on your phone with Wi-Fi off, or ask someone on a different connection. Fresh there too means you’re genuinely clear.

The response-header check. In DevTools (F12) → Network tab, reload and click the main page request. A MISS means the copy was rebuilt just now — exactly what you want. A HIT means it came from a cache; if the content is still old, you missed a layer.

The eyeball check. Actually look at the thing you changed. The new price, the new text, the new image. Don’t assume — confirm.

Related win: stale cached pages can quietly waste your search crawl budget. I explain that cleanup in stop wasting crawl budget on your WordPress site, and WordPress’s own optimization documentation is a solid next read on keeping WordPress fast.

Verified on all fronts? Then the emergency is officially over. Well done.

Frequently Asked Questions

Will clearing my cache delete my content or break my site?

No — this is the fear I most want to kill. Clearing a cache only deletes temporary saved copies; your posts, pages, products, and settings are untouched.

How often should I clear my WordPress cache?

Only when you need to — after changes that aren’t showing up. A healthy setup purges the right pages automatically. If you’re purging daily just to keep the site looking right, something in your setup needs attention.

I cleared the cache and nothing changed. What now?

You cleared the wrong layer — the most common outcome in my inbox. It’s nearly always a missed upstream layer: usually the CDN, sometimes the browser, occasionally OPcache for code edits. Run the Step 0 tests and climb the checklist in order instead of repeating the same purge.

Why do I see my changes when logged in, but visitors see the old version?

Most caching setups bypass the cache for logged-in users. You see the live truth; visitors get the saved copy. Purge the page cache (Method 2) and check in an incognito window to see what your visitors see.

Does clearing the cache slow down my website?

Briefly — the first visits after a purge take slightly longer while pages rebuild, then the cache is warm and speed is back to normal.

Final Thoughts

You came here because your changes weren’t showing and nobody could tell you why. Now you know what most site owners never learn: there is no single cache — there’s a stack of six layers, and you can diagnose which one is stale, purge each one, and verify the fix like a professional. For the browser layer in detail, read the browser caching for WordPress complete setup guide. If a stylesheet still looks wrong after a purge, check CSS specificity in WordPress. Before you edit server files, compare manual backups vs backup plugins. If you are still stuck, find out where to get real WordPress help. If a Customizer change still does not show, see WordPress Customizer like a pro.

That store owner? Her flash sale went live with correct prices eleven minutes after her panicked message. Not because I’m a genius — because I stopped guessing and climbed the ladder in order. That’s the whole secret, and now it’s yours.

One honest line before you go: I still get caught by this sometimes. Last month I spent twenty minutes purging a test site before remembering OPcache — the very layer I warn everyone about. The checklist exists because my memory can’t be trusted at midnight. Use it shamelessly.

Now go purge with confidence — and if a weird caching mystery stumps you, or this guide saved your sale, tell me in the comments. I read every one, and the strangest stories become my next guide.

Written by

Ahmed Raza

Ahmed has spent 9 years building high-traffic WordPress sites and contributing to core performance discussions. He writes about site architecture, scaling, and the engineering decisions behind fast websites.

5 published articles
View all articles

Related articles

View all articles

5 comments

Join the discussion

Your email address will not be published. Required fields are marked *

Keep comments relevant and respectful.