Most WordPress pages should be cached, but a few need to be built fresh for every visitor: a page that shows live stock or prices, a members-only area, a booking calendar, or a form from a plugin that doesn't play well with caching. This guide shows how to exclude a page from the LiteSpeed Cache on your Instant Access Internet Services site, either one page at a time or by URL pattern, cookie or user role.
Do you really need to exclude it?
LiteSpeed Cache already handles the pages that must never be shared between visitors, so you don't need to add these yourself:
- Pages viewed by logged-in users. These are never served from the shared cache; with the default Cache Logged-in Users setting they're kept in a private cache for that one user only.
- The WordPress admin area and the login page.
- WooCommerce Cart, Checkout and My Account pages.
If a page only looks out of date after you edit it, you probably need to purge it rather than exclude it. Excluding a page makes it slower for every visitor, so only exclude what really must stay dynamic.
Option 1: Exclude a single page from the editor
This is the easiest way to exclude one post, page or product.
- In WordPress, open the page for editing (Pages > All Pages, then click the page title).
- Find the LiteSpeed Options box. In the block editor it's usually below the content; in the Classic Editor it's in the sidebar or under the content.
- Turn on the Disable Cache switch (it turns blue).
- Click Update (or Save).
If you don't see the box, in the block editor open the three-dot menu > Preferences > Panels and enable LiteSpeed Options. In the Classic Editor, open Screen Options at the top and tick LiteSpeed Options.
Option 2: Exclude pages by URL with Do Not Cache URIs
Use this for a group of pages, such as everything under /members/, or when a page isn't a normal WordPress post.
- Go to LiteSpeed Cache > Cache and click the Excludes tab.
- In Do Not Cache URIs, enter one path per line. Leave out the domain name.
- Click Save Changes, then purge the cache (LiteSpeed admin bar icon > Purge All).
How the matching works:
| You enter | What it excludes |
|---|---|
/members/ | Any URL that contains /members/ anywhere (partial match) |
^/members/ | Only URLs that start with /members/, such as /members/profile/ |
/booking/$ | Only URLs that end in exactly /booking/ |
^/contact/$ | Exactly the /contact/ page and nothing else |
Be careful with short partial matches. An entry like /shop also matches /shopping-tips/ and /workshop/.
Other ways to exclude content
The same Excludes tab has more options. Enter one item per line.
- Do Not Cache Query Strings - skip caching when a URL has a certain query string, for example
currencyfor?currency=EUR. - Do Not Cache Categories and Do Not Cache Tags - skip posts in a particular category or with a particular tag.
- Do Not Cache Cookies - skip caching for visitors who have a certain cookie. Useful for plugins that personalize pages with a cookie (a wishlist or a currency switcher, for example). The plugin's own documentation usually names the cookie.
- Do Not Cache User Agents - skip caching for particular browsers or apps. Rarely needed.
- Do Not Cache Roles - tick roles (for example Shop Manager or Editor) whose visits should never be cached, not even in the private cache. Handy if you're an administrator testing changes and always want to see fresh pages.
Exclude a page from optimization but keep it cached
Sometimes the page cache is fine and it's the CSS/JS optimization that breaks a page. In that case, keep the page cached and exclude it from optimization instead: go to LiteSpeed Cache > Page Optimization > Tuning and add its path to URI Excludes. The page stays fast, but its CSS and JS are left alone.
How to check the exclusion worked
Open the page in a private browser window, press F12, go to the Network tab, reload and click the first request. An excluded page no longer shows x-litespeed-cache: hit. Instead you'll usually see an x-litespeed-cache-control: no-cache header. If it still says hit, purge all and check again.
Common questions
My contact form says "nonce" or "expired" errors
Some form plugins put a security token in the page that expires. Try excluding the form page with the Disable Cache switch first. If the form is on every page (in a footer, for example), open a ticket and we can help you find a better fix.
Can I exclude a whole post type?
Not directly from the Excludes tab. If all posts of that type share a URL prefix, such as /events/, exclude that prefix with ^/events/ in Do Not Cache URIs.
Related guides
- How to Clear (Purge) the LiteSpeed Cache in WordPress
- LiteSpeed Cache and WooCommerce: Settings for Online Stores
- How to Fix Website Problems Caused by LiteSpeed Cache
- How to Check If LiteSpeed Cache Is Working on Your Site
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
