Fix W3 Total Cache’s Missing WooCommerce Category Purge
W3 Total Cache silently fails to purge WooCommerce product category and tag pages when products are updated. This plugin fixes that — automatically, with zero configuration.
The Problem
Your WooCommerce Category Pages Are Serving Stale Cache
W3 Total Cache has a setting called “Post terms pages” under its purge policy. It sounds like it should flush your WooCommerce category pages when products change. It doesn’t.
The setting only works for standard WordPress taxonomies — not WooCommerce taxonomies like product_cat, product_tag, or any custom product taxonomies you’ve registered.
This is a well-known gap in W3 Total Cache that has never been officially fixed. We ran into it ourselves on our own WooCommerce store at discountdeal.in and built this plugin to solve it properly.
Comparison
What Gets Purged — With vs. Without This Plugin
| Event / Page Type | W3TC Alone | + This Plugin |
|---|---|---|
| Standard WordPress taxonomy pages | ✓ | ✓ |
| WooCommerce product_cat pages | ✗ | ✓ |
| WooCommerce product_tag pages | ✗ | ✓ |
| Custom product taxonomies (brands, etc.) | ✗ | ✓ |
| Paginated category pages (page/2/, page/3/) | ✗ | ✓ |
| Parent category pages (product count changes) | ✗ | ✓ |
| Purge on bulk edit / quick edit | ✗ | ✓ |
| Purge on stock change | ✗ | ✓ |
| Purge on REST API / WooCommerce import | ✗ | ✓ |
| Works with Redis & Memcached backends | Partial | ✓ |
Features
Everything It Handles — Automatically
All WooCommerce Taxonomies
Purges product_cat, product_tag, product_shipping_class, and any custom product taxonomy registered on your site — including third-party ones like brands or attributes.
Hooks Into W3TC’s Pipeline
Uses W3TC’s own w3tc_flush_url() API — so it works with whatever cache backend you’ve configured: disk, Redis, Memcached, or APC.
Bulk & REST API Support
Covers bulk edits, quick edits, WooCommerce imports, and REST API product updates — all the operations that bypass the standard WordPress save flow.
Paginated Pages
Flushes /page/2/, /page/3/, and so on — automatically calculated from your product count and WooCommerce catalog settings. Capped at 5 pages to protect server performance.
Recursive Parent Purge
When a product is updated, its parent categories are also purged — because their product counts change too. Works all the way up the category tree.
Safe & Efficient
A built-in deduplication tracker ensures each term is only flushed once per request. A recursion depth cap prevents any risk from corrupted database term hierarchies.
How It Works
The Technical Fix, Explained Simply
The root cause is that W3TC’s purge engine looks at WordPress’s native taxonomy system when deciding what to flush — and WooCommerce registers its taxonomies in a way that W3TC’s built-in logic doesn’t pick up. This plugin bridges that gap:
Hooks into W3TC’s w3tc_flush_post action
When W3TC begins flushing a product post, this plugin intercepts the action and identifies which WooCommerce taxonomy terms are attached to that product.
Calls w3tc_flush_url() for each term archive
For every product category, tag, or custom taxonomy term — including all paginated pages — the plugin calls W3TC’s official flush API, which works with all cache backends.
Handles WooCommerce-specific events separately
Stock changes, bulk edits, REST API updates, and direct term edits all fire additional hooks that also trigger the purge — so nothing slips through.
Walks up the parent category tree
After flushing a term, the plugin recursively flushes its parent terms too — because a product update changes counts all the way up the hierarchy.
// Core logic — hooks into W3TC's own flush pipeline add_action( 'w3tc_flush_post', function( $post_id ) { if ( get_post_type( $post_id ) === 'product' ) { // Get all WooCommerce taxonomy terms for this product $terms = get_the_terms( $post_id, 'product_cat' ); foreach ( $terms as $term ) { w3tc_flush_url( get_term_link( $term ) ); } } } );
Installation
Up and Running in 60 Seconds
Both W3 Total Cache and WooCommerce must be installed and active before installing this plugin.
- Go to Plugins → Add New in your WordPress dashboard and search for W3TC WooCommerce Taxonomy Purge
- Click Install Now, then Activate
- Done — there is no settings page. The plugin activates silently and begins purging WooCommerce taxonomy pages immediately
Alternatively, download the zip from WordPress.org and upload via Plugins → Add New → Upload Plugin.
FAQ
Frequently Asked Questions
w3tc_flush_url() function, which routes through whatever cache backend you have configured — disk enhanced, disk basic, Redis, Memcached, or APC. It doesn’t bypass W3TC’s cache engine at all.init (at priority 999, after all taxonomies are registered), the plugin fetches every taxonomy associated with the product post type and adds it to the purge list automatically. This includes WooCommerce product attributes (pa_color, pa_size, etc.) and any custom taxonomies added by third-party plugins. You can also extend the list manually using the w3tc_woo_purge_taxonomies filter.woocommerce_update_product and woocommerce_new_product — these fire regardless of whether the update came from the WordPress editor, the REST API, a WooCommerce import, or a third-party integration.About
Built From a Real Problem
This plugin was created by the team at Discount Deal — an Indian deals and discount coupons platform covering offers from Amazon, Flipkart, Myntra, and more. We run WooCommerce with W3 Total Cache on our own production store and hit this exact caching bug ourselves.
After spending time debugging why our category pages were showing stale product counts even after updating products, we traced the issue back to W3TC’s taxonomy purge not covering WooCommerce taxonomies at all. We built this plugin as a proper fix, tested it on our live store, and published it on WordPress.org for free so others don’t have to go through the same debugging process.
If you find it useful, feel free to browse our latest deals on Discount Deal — that’s how we keep the lights on.
Stop Serving Stale Category Pages
Free, zero-configuration, and live on WordPress.org. Install it in under a minute.



