What is the wc_fragments cookie?
wc_fragments is generated by the WooCommerce plugin, the most widely used e-commerce system for WordPress. It is not a classic HTTP cookie but a locally stored entry in the browser's sessionStorage, created by WooCommerce's "AJAX cart fragments" mechanism.
It appears as soon as a visitor lands on a WooCommerce store page and is refreshed every time the cart changes (adding/removing a product, applying a coupon, etc.), without requiring a page reload.
What data it stores
The value stored under wc_fragments is a JSON object containing predefined HTML fragments – for example, the text shown in the cart icon ("X items, $Y") or the mini-cart contents. The exact format of the value can vary depending on the theme and store configuration.
The data stays only in the visitor's browser, in sessionStorage, and is not sent to third-party servers; it is used locally by the WooCommerce script to refresh cart-related visual elements.
What it is used for
Its purpose is strictly functional: it allows the shopping cart's state to be displayed correctly and in real time on any page of the site, including when the page is served from a cache (common on WooCommerce stores using page-level caching).
Without this mechanism, cart information could remain outdated on cached pages, directly affecting the shopping experience.
Does it require consent?
In CookieFix's classification, wc_fragments falls under the strictly necessary category, since it supports an essential store function (the shopping cart), does not track visitors, and does not serve marketing or analytics purposes.
Under the ePrivacy Directive (transposed in Romania via Law 506/2004) and GDPR, cookies/storage that are strictly necessary to provide a service explicitly requested by the user do not require prior consent. The site operator should still list it in the cookie policy, with the correct purpose and category.
How to block or delete wc_fragments
A visitor can manually delete this entry from browser settings (Developer Tools → Application/Storage → Session Storage) or block local storage through browser privacy settings; doing so may affect the shopping cart display.
- Being strictly necessary, it should not be blocked pending consent, unlike statistics or marketing cookies.
- A CMP such as CookieFix can still automatically block non-essential scripts on the page until consent is given, while leaving strictly necessary elements — such as the mechanism behind
wc_fragments— functional.
Frequently asked questions
Technically it's a sessionStorage entry, not a classic HTTP cookie, but it's treated similarly from a privacy standpoint since it's set by the WooCommerce script.
No, it's classified as strictly necessary because it supports basic shopping cart functionality, so it doesn't require prior consent under ePrivacy and GDPR.
It's kept only for the duration of the browsing session, since it's stored in sessionStorage; it's automatically cleared when the tab or browser is closed.
Cart elements (item count, subtotal) may fail to update correctly on cached pages, affecting the shopping experience.