# Skip W3 Total Cache on Chosen Pages

> Tells W3 Total Cache not to page-cache, minify or serve from CDN the pages you choose, using its documented DONOTCACHEPAGE-style constants.

- Type: PHP
- Runs: Frontend cl
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: w3-total-cache, cache, exclusions
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/w3tc-skip-cache-rules/

## Code

```php
$wpide_pages       = array( 'checkout-custom', 'live-scores' ); // Page slugs or IDs.
$wpide_skip_minify = true;                                       // Also skip minify and CDN.

add_action( 'template_redirect', function () use ( $wpide_pages, $wpide_skip_minify ) {
    if ( ! defined( 'W3TC' ) || ! is_page( $wpide_pages ) ) {
        return;
    }

    if ( ! defined( 'DONOTCACHEPAGE' ) ) {
        define( 'DONOTCACHEPAGE', true );
    }
    if ( $wpide_skip_minify && ! defined( 'DONOTMINIFY' ) ) {
        define( 'DONOTMINIFY', true );
    }
    if ( $wpide_skip_minify && ! defined( 'DONOTCDN' ) ) {
        define( 'DONOTCDN', true );
    }
} );
```

## Notes

List page slugs or IDs; set $wpide_skip_minify to false to keep minification on those pages.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Skip W3 Total Cache on Chosen Pages" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
