# How to clear the cache on a WordPress or WooCommerce site

> On WordPress, a change that doesn't show up usually passes through up to four different cache layers before reaching the visitor. Clearing them in the right order avoids jumping to the conclusion that a change wasn't saved.

- Source canonique : [https://allaux.fr/en/guides/vider-cache-wordpress](https://allaux.fr/en/guides/vider-cache-wordpress)
- Langue : EN
- Dernière mise à jour : 2026-09-30

## The most common situations

- A price or text edited in the back office that still isn't showing for visitors after several minutes
- A new image that still shows the old version on some devices
- A code fix that's been applied but seems to have no effect
- A caching plugin showing a success message but the rendered page hasn't changed

## The four layers to clear, in order

1. **The caching plugin's cache** — If a plugin like WP Rocket, W3 Total Cache or LiteSpeed Cache is active, each one offers a dedicated button on its own settings screen or in the WordPress admin bar. This is the first layer to clear.
2. **The object cache or server cache** — Some hosts add a memory cache (Redis, Memcached) or a page cache at server level, independent of WordPress plugins. It's usually cleared from the hosting panel or via a dedicated command the host provides.
3. **The CDN cache** — If static files are served through a CDN (Cloudflare or similar), their cache is separate and gets cleared from the CDN's own interface, not from WordPress.
4. **The browser cache** — As a last resort, checking in a private browsing window or forcing a full reload (Ctrl+F5) rules out a purely local cache on the machine testing the change.

## Why so many layers

WordPress itself doesn't systematically cache pages by default: each view normally recalculates the page from the database. It's precisely to offset this cost, higher than with a precompiled template system, that almost every WooCommerce install adds one or more cache layers.

The problem comes from how they stack: a page-caching plugin can itself rely on an object cache for database queries, with everything then served through a CDN that applies its own retention period. A change can therefore be correctly saved in the database without being visible until every layer has expired or been cleared.

On a WooCommerce product page, a cache that isn't cleared properly after a stock or price change can show incorrect availability or a wrong price: this is one of the rare cases where the cache has a direct commercial impact, not just a visual one.

## The WooCommerce fragment cache

> WooCommerce caches certain cart-related fragments (the mini-cart shown in the header, for example) via dedicated AJAX requests. A cart that doesn't show the right quantity after an action is often down to this fragment cache rather than the regular page cache.

## A useful exclusion mode during development

Most WordPress caching plugins offer an exclusion mode for certain pages or for visitors logged in as an administrator, who then always see a fresh version without going through the cache. This setting is what makes it possible to check a change in real time without clearing the cache after every attempt during a work session.

Once the change is confirmed, it's still essential to clear the cache manually at least once so that logged-out visitors see the new version, since the exclusion mode doesn't apply to them.

## FAQ

### How can I tell if the site uses a CDN?

The simplest way is to check the response header of static files (images, CSS) in the browser's developer tools: a header mentioning Cloudflare or another CDN name confirms it's in use.

### Can clearing every cache temporarily slow the site down?

Yes, the first visits after a clear recalculate each page, which takes a little longer than usual. Normal speed returns as the cache rebuilds.

### The price shown is still wrong even after clearing every cache — what now?

Check the price rule or variation responsible directly in WooCommerce: a misconfigured conditional pricing rule isn't a cache problem, even if the symptom looks like one.
