How to Exclude Cookies From BerqWP’s Page Cache Rules

BerqWP’s Exclude Cookies setting lets you stop a page from being served out of cache whenever a specific cookie is present on the visitor’s browser. This article covers how it works, what’s already excluded by default, and how to add your own.

TL;DR: BerqWP already excludes five common cookies from caching by default, including WooCommerce’s cart cookie. You can add more under BerqWP > Cache Management > Exclude Cookies, one per line. Matching is based on the start of the cookie name, not the full name or a contains-anywhere match.

What This Setting Actually Does

When a visitor’s browser sends a cookie that matches one of your excluded entries, BerqWP skips serving them a cached version of the page and generates it fresh instead. This matters for any cookie that signals the visitor needs to see something different from what a cached page would show them, a logged-in state, an active cart, a form submission they just made.

What’s Already Excluded by Default

Before you add anything yourself, BerqWP already excludes these cookies automatically:

  • berqwpnocache
  • wp-postpass
  • comment_author
  • woocommerce_cart_hash
  • edd_items_in_cart

This covers password-protected pages, recent commenters, and active WooCommerce or Easy Digital Downloads carts out of the box, so you generally don’t need to add these yourself.

How the Matching Actually Works

When you enter a cookie ID, BerqWP checks whether the visitor’s cookie name starts with what you entered, not whether it appears anywhere in the name. For example, entering woocommerce_cart_hash matches a cookie named exactly that, but entering cart_hash on its own would not match it, since the cookie name doesn’t start with cart_hash.

If you’re not sure of a cookie’s exact name, check your browser’s developer tools under Application (or Storage) > Cookies while on the page in question, and use the beginning of the cookie name you find there.

How to Add Your Own

  1. Go to BerqWP > Cache Management
  2. Find Exclude Cookies
  3. Enter the cookie ID, one per line, matching from the start of the real cookie name
  4. Save your changes

When You’d Actually Need This

Most sites never need to touch this setting, since BerqWP’s defaults already cover the most common cases. You’d add your own entry if a plugin sets a cookie that should bypass the cache but isn’t covered by the defaults, for example a membership plugin, a custom quiz or quote tool, or a third-party booking system that needs to show different content to a visitor mid-session.

Offload Performance Headache to BerqWP

No configurations
Built for non techies
100% risk free
BerqWP v4 Dashboard
AI Support
Online
Powered by WP Replai