Advanced cache rules decide which requests get a cached page, which ones always go to WordPress, and when one URL needs more than one cached copy. The defaults are safe for most sites. Add rules when a page shows content that must stay live, or when visitors arrive with tracking or filter parameters in the URL.
Available in: Powered Cache (free)
Where to find it: Powered Cache → Advanced
Requires: Page caching turned on.
The .htaccess Configuration setting on the same screen is described in Server Configuration.

How the rules work #
- Every field takes one rule per line. Empty lines are ignored.
- Rules are checked before a cached page is sent. A request that matches an exclusion always gets a freshly built page, and the result is not saved.
- Saving the settings writes the rules to the cache configuration file that the page cache reads. Changes apply to new requests right away. Pages that are already cached stay in the cache until they are cleared, so use Purge Page Cache after you add an exclusion. See Clear Cache.
- Cache Preload skips URLs that you exclude here.
Matching syntax: wildcards and regular expressions #
The fields do not all match the same way. This table shows what each one compares and which syntax it accepts:
| Setting | Compared with | A line matches when | Wildcards and regex |
|---|---|---|---|
| Never Cache URLs | The requested path, including the query string | The whole path matches the line | Yes |
| Rejected User Agents | The browser’s user agent | The line is found anywhere in it | Yes |
| Rejected Cookies | The names and values of the visitor’s cookies | The line is found anywhere in them | Yes |
| Rejected Referrers | The referring URL | The line is found anywhere in it | Regex only, no wildcards |
| Vary Cookies | Cookie names | The cookie name is exactly the same | No |
| Ignored Query Strings, Cache Query Strings | Query parameter names | The parameter name is exactly the same | No |
| Purge Additional Pages | Page paths | Not a match: each line is one page to clear | No |
Matching is case-sensitive, so write the text with the same upper and lower case as the URL, user agent or cookie. Rejected Referrers lines that use regex are the exception, they ignore case.
In the fields that accept wildcards and regex, Powered Cache reads each line in one of three ways:
- Wildcard: the line contains
*and none of the characters( ) [ ] { } | ^ $ + \. Then*matches any text, including nothing and including/. Every other character is taken literally, including.and?. Example:/shop/*. - Regular expression: any other line is used as a regular expression, for example
/(en|de)/account/.*. If a line is meant as plain text but also happens to be valid regex, such asapp.js?ver=2, it still matches its own exact text. - Plain text: a line that is not valid regex, such as
/sale-(50, is matched as plain text. The settings screen then shows: These lines are not valid regular expressions, so they are matched as plain text. Use*instead, or escape regex characters with a backslash.
New in 4.0: Wildcards (
*) work in Never Cache URLs, Rejected User Agents and Rejected Cookies, and a broken line no longer disables the other rules in the field. If you updated from 3.x, go to Powered Cache → Tools and click Fix configuration once, so your existing rules are written with the new matching. See Fix Configuration.
Cache exclusions #
Never Cache URLs #
Pages that are never cached. Default: empty. Use it for pages that show live or personal content to logged-out visitors, such as a custom cart, a booking form or a page with a live stock ticker.
Each line must match the whole requested path, from the first / to the end, including any query string. So /shop matches only /shop, not /shop/ or /shop/shoes/. Add * where the path can continue.
| Rule | Matches | Does not match |
|---|---|---|
/contact/ | /contact/ | /contact/thanks/ |
/checkout/* | /checkout/, /checkout/payment/ | /checkout |
/cart* | /cart/, /cart-items/, /cartoon/ | /shop/cart/ |
/members/*/profile/ | /members/anna/profile/ | /members/anna/ |
*preview=* | Any URL with preview= in it | |
/(en|de)/account/.* (regex) | /en/account/, /de/account/orders/ | /fr/account/ |
- You can paste a full URL, such as
https://example.com/landing/. Powered Cache uses only its path,/landing/. - If WordPress is installed in a subfolder, include that folder, for example
/blog/checkout/*. - To exclude a single post or page, Exclude Page From Cache in the editor can be easier.
You do not need to add WooCommerce cart, checkout and account pages. WooCommerce marks them as not cacheable on its own. If you use WPS Hide Login, Powered Cache adds your custom login URL automatically.
Rejected User Agents #
Browsers, bots or tools that never get a cached page. Default: empty. A line matches when it appears anywhere in the user agent, for example UptimeRobot for a monitoring service that must check the live page.
Built in: facebookexternalhit is always rejected, so Facebook link previews read the current title and image. Leave search engine bots out of this list: they should get fast, cached pages.
Rejected Cookies #
Visitors with a matching cookie skip the cache. Default: empty. Use it when a plugin stores per-visitor state in a cookie and changes the page HTML for that visitor, for example a cart or a “recently viewed” list. A line matches when it appears anywhere in the visitor’s cookie names or values, so a prefix such as my_plugin_cart is enough.
Built in: these WordPress cookies always bypass the cache, so you do not need to add them: wordpress_logged_in_, wordpress_sec_, wordpressuser_, wordpresspass_, wp-postpass, comment_author_, comment_author_email_, comment_author_url_ and powered_cache_commented_posts. When Logged-in User Cache is on, logged-in visitors get their own cached copy instead.
Keep this list short. Every visitor with a matching cookie puts full load on WordPress.
Rejected Referrers #
Visitors who arrive from a matching page skip the cache. Default: empty. Use it when a partner site or campaign sends visitors who must see a live page.
- A line without special characters is plain text and matches anywhere in the referring URL, with the same upper and lower case. Example:
partner-site. - A line with any of
^ $ . | ? * + ( ) [ ]is a regular expression that ignores case. Example:^https://(www\.)?partner\.com/. A plain domain such aspartner.comalso works, because its dot matches any character. - Wildcards are not supported. A line such as
*partner*is an invalid regular expression and never matches.
When Apache or LiteSpeed serves cached pages directly through the .htaccess rules, it does not check referrers. See below.
Cache variants #
Vary Cookies #
Keeps a separate cached copy for each value of the listed cookies. Default: empty. Enter exact cookie names, one per line.
Unlike Rejected Cookies, visitors with these cookies still get cached pages, just a different copy. Visitors without the cookie, or with an empty value, share the standard copy. This is the right tool when a cookie changes what the page shows, but only has a few possible values, such as:
- Cookie consent: the banner must disappear after a visitor accepts, and tracking scripts load only after consent. Add the cookie that your consent plugin sets after the visitor’s choice.
- Currency or region switchers that store the choice in a cookie.
Powered Cache adds the cookies of these consent and currency plugins automatically, so you do not need to list them:
| Plugin | Cookies added |
|---|---|
| Cookie Notice & Compliance | cookie_notice_accepted |
| CookieYes | GDPR Cookie Consent | viewed_cookie_policy and the cookielawinfo-checkbox-… cookies |
| GDPR | gdpr[allowed_cookies], gdpr[consent_types] |
| EU Cookie Law for GDPR/CCPA | euCookie, when the banner is enabled |
| Cookies and Content Security Policy | cookies_and_content_security_policy, when the plugin is active |
| WooCommerce Multilingual & Multicurrency | wcml_client_currency, wcml_client_currency_language, wcml_client_country |
For another consent plugin, accept the banner on your site, then open the browser’s developer tools (Application or Storage tab → Cookies) and look for the cookie it created. Add its exact name, for example my_consent_status. See also Plugin and Theme Compatibility.
- Never add a cookie that holds a unique value per visitor, such as a session ID. Every visitor would get their own copy, and the cache would barely help.
- While Vary Cookies has any entry, including ones added automatically, Apache and LiteSpeed no longer serve cached files directly through
.htaccess. Cached pages are then served by PHP, which is still fast, and can pick the right copy.
Query strings #
By default, a URL with a query string, such as /shop/?color=red, is not cached. These two settings change that. Both take exact parameter names, one per line, without ? or =.
Ignored Query Strings #
Parameters that do not change the page. When all parameters of a URL are on this list, the visitor gets the normal cached page, as if there were no query string. Default: empty.
Built in: these common tracking parameters are always ignored, so you do not need to add them: fbclid, fb_action_ids, fb_action_types, fb_source, ref, gclid, utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_expid, _ga, mc_cid, mc_eid, campaignid, adgroupid, adid, age-verified, usqp, cn-reloaded and ao_noptimize.
Add other tracking parameters that your campaigns use, for example msclkid or utm_id. Wildcards do not work here, so list each parameter. Analytics scripts still read the parameters in the browser, because the URL itself does not change.
Cache Query Strings #
Parameters that change the page, and should get their own cached copy for each value. Default: empty. For example, with color on the list, /shop/?color=red and /shop/?color=blue are cached separately. This also works for public REST API requests with parameters.
- A URL is cached when it has at least one listed parameter. Other parameters in the same URL do not create extra copies.
- A URL with an unlisted parameter, and no listed one, is not cached.
- When you add at least one parameter,
langis included as well. - With WooCommerce, when the default customer location is set to Geolocate (with page caching support), Powered Cache adds WooCommerce’s
vparameter automatically.
Only add parameters with a small number of values. A search or a date parameter can create thousands of copies.
Purge behavior #
Purge Additional Pages #
Pages to clear whenever a post’s cache is cleared, for example when you publish, update or trash a post, or use Purge Current Page. Default: empty. Use it for pages that list posts but are not archives, such as a landing page with a “latest articles” block.
/
/landing-page/
/resources/latest/
- Enter paths on your site, one per line. Full URLs on your own site work too.
- Each line clears that one page. Wildcards are not supported, and pages below it, such as
/resources/latest/page/2/, are not cleared. - New comments clear only the post they belong to, not these pages.
The home page, the posts page and the post’s archives are already cleared automatically. See When the cache is cleared automatically.
When the web server serves cached pages #
With .htaccess Configuration on, Apache and LiteSpeed can send cached files without starting PHP. These rules check a shorter list of conditions:
- Rejected User Agents and Rejected Cookies are included, and match regardless of upper or lower case.
- Every URL with a query string goes to PHP, which then applies your query string rules.
- Never Cache URLs need no server rule, because those pages are never saved.
- Rejected Referrers are not included. A visitor from a rejected referrer can still get a cached page from the server. If that matters, turn off .htaccess Configuration and remove the Powered Cache block from
.htaccess. - While Vary Cookies has entries, the server rules are not used at all.
For developers #
Each list has a filter, so a plugin can add rules without changing the settings:
| Filter | Changes |
|---|---|
powered_cache_rejected_uri_list | Never Cache URLs |
powered_cache_rejected_user_agents | Rejected User Agents, including the built-in value |
powered_cache_rejected_cookies | Rejected Cookies, including the built-in WordPress cookies |
powered_cache_rejected_referrers | Rejected Referrers |
powered_cache_vary_cookies | Vary Cookies |
powered_cache_ignored_query_strings | Ignored Query Strings, including the built-in list |
powered_cache_cache_query_strings | Cache Query Strings |
powered_cache_post_related_urls, powered_cache_advanced_cache_purge_urls | The URLs cleared when a post’s cache is cleared |
add_filter( 'powered_cache_vary_cookies', function ( $cookies ) {
$cookies[] = 'my_consent_status';
return $cookies;
} );
The exclusion and query string lists are written to the cache configuration file when settings are saved. After you add or change such a filter, click Fix configuration in Powered Cache → Tools. Put the code in a small custom plugin or a must-use plugin. See the hook reference and Hooks Reference.