
When WooCommerce add to cart works for you but not for your customers, start with caching. The usual culprits are a cart page served from a page cache or CDN, a cache layer that ignores WooCommerce session cookies, or a cached product page carrying a security token (nonce) that has already expired. The second most common cause is a JavaScript error, often from minified or combined scripts, a plugin update or a theme change, which stops the button's request from being sent at all.
You can tell these apart in about half an hour. Open the store in a private window as a guest, click the button with the browser's network panel open, and look at what request goes out, what status comes back and which cache headers the cart page carries. Black Friday falls on 27 November 2026 and Cyber Monday on 30 November. In the days before them, many stores tighten cache rules, add CDN rules and install updates, and every one of those changes can break the button while your uptime monitor stays green.
?wc-ajax=add_to_cart for classic AJAX buttons, a form POST on single product pages, or /wp-json/wc/store/v1/cart/add-item for block-based stores.Peak preparation means caching changes. The most common one is a CDN rule that starts caching HTML. Cloudflare's documentation states that its CDN "does not cache HTML or JSON by default". Once someone adds a cache rule to cache everything, your cart page can become a cached file unless the rule excludes it or the origin response prevents storage. Cloudflare will not store a response that carries a Set-Cookie header, which protects some cart responses but not cached product pages that show a mini-cart.
WooCommerce's guide to configuring caching plugins lists three pages to exclude from caching: Cart, My Account and Checkout. It says they "need to stay dynamic since they display information specific to the current customer and their cart." It also names the cookies a cache should treat as a signal to bypass: woocommerce_cart_hash, woocommerce_items_in_cart and wp_woocommerce_session_. A rule that excludes /cart/ by path but ignores those cookies will still serve cached product pages to shoppers who have items in their cart, so the mini-cart in the header shows zero.
Expired nonces come next. Block-based add to cart buttons talk to the WooCommerce Store API, and its documentation says the cart/add-item endpoint "will return an error unless a valid Nonce Token or Cart Token is provided." The WordPress nonce documentation gives a default lifetime of one day and explains that the real lifetime falls between 12 and 24 hours. If your page cache holds product pages for longer than that, some visitors receive a page with a stale token embedded in it.
The release calendar adds to this. WooCommerce 11.3.0 shipped on 11 November 2026 with a database update and changes to several product blocks, including the Product Gallery and Product Collection, plus a new read-only parent_item_key field on Store API cart items. The release notes mark it as backwards compatible, and nothing in them describes a change to add to cart. Themes and plugins that customise product blocks or read cart item data still deserve a test on staging. Our WooCommerce 11.3 pre-peak guide covers that update in detail.
The mini-cart can also make a working button look broken. Since WooCommerce 7.8, the wc-cart-fragments script loads only on pages where the Cart widget is rendered, according to the WooCommerce developer blog. A theme that depended on fragments loading everywhere may stop updating its header cart count. The item is in the cart, the counter says zero, and the shopper clicks again or leaves.
/?wc-ajax=add_to_cart. Single product pages usually submit a form POST to the product URL. Block-based buttons send POST /wp-json/wc/store/v1/cart/add-item.cart/add-item that mentions the nonce means the page carried a stale or missing token. A 400 on a variable product often means no variation was selected or the variation no longer exists. A 500 is a PHP error, so check WooCommerce > Status > Logs for a fatal-errors entry.cf-cache-status: HIT, an x-cache: HIT or a non-zero Age header on /cart/ means a cache is serving it.woocommerce_items_in_cart, woocommerce_cart_hash and a wp_woocommerce_session_ cookie. If those cookies never arrive, or arrive and the next page still comes from cache, your cache bypass rules are incomplete.| Likely cause | What the shopper sees | Where to check | Usual owner |
|---|---|---|---|
| Cart page cached at CDN or server | Cart empty after adding a product, or someone else's cart | curl -sI on /cart/, CDN cache rules |
Agency or host |
| Session cookies not bypassing cache | Header cart shows 0 on product pages | Cache plugin cookie exclusions, CDN rules | Agency |
| Stale nonce in cached page | Button spins, then error; nonce error from add-item |
Network tab, page cache lifetime | Agency |
| JavaScript minify or combine | Button does nothing, no request sent | Console errors, performance plugin settings | Agency |
| Plugin or theme conflict after update | Button broken on one template or product type | Staging conflict test | Agency or developer |
| Firewall or bot rule | 403 for some visitors or countries | WAF and security plugin logs | Host or agency |
| Missing or invalid variation | 400 on variable products only | Product edit screen, variation stock | Store manager |
Hand this to whoever manages your cache plugin, server cache and CDN. Adjust the paths if your cart or checkout pages use a different slug or a language prefix.
NEVER CACHE (page cache and CDN)
/cart/* (or your cart slug, every language)
/checkout/* (or your checkout slug)
/my-account/*
any URL containing ?add-to-cart=
any URL containing ?wc-ajax=
/wp-json/wc/store/*
BYPASS CACHE WHEN THE REQUEST CARRIES ANY OF THESE COOKIES
woocommerce_items_in_cart
woocommerce_cart_hash
wp_woocommerce_session_*
PAGE CACHE LIFETIME
Keep cached HTML shorter than 12 hours if pages embed nonces,
or confirm your cache plugin refreshes nonces on cached pages.
Quick header check from a terminal (replace the domain and slugs):
for p in / /cart/ /checkout/ /my-account/; do
echo "== $p"
curl -sI "https://example-store.com$p" | grep -iE 'cf-cache-status|x-cache|^age|cache-control|set-cookie'
done
Pre-peak add to cart test plan:
Run after every cache rule change, plugin update or theme change,
and once a day from now until the end of Cyber Monday.
[ ] Guest, desktop, private window: simple product from shop archive
[ ] Guest, desktop: simple product from single product page
[ ] Guest, desktop: variable product, select variation, add
[ ] Guest, phone on mobile data: repeat the three tests above
[ ] Header mini-cart count updates without a page reload
[ ] Cart page shows the item; refresh keeps it there
[ ] Second browser, guest: cart is empty (not the first browser's cart)
[ ] Logged-in customer account: add, view cart, start checkout
[ ] Repeat all guest tests 10 minutes after a cache purge
[ ] Record date, tester, result and any error text in the change log
The "second browser" line matters most. If a fresh guest sees items they never added, the cart page is cached and is showing one shopper's session to another.
The numbers here are illustrative, not data from a real store.
A store that sells kitchen equipment expects four times its normal traffic on Black Friday. On 16 November, the agency adds a CDN rule that caches HTML for two hours, with exclusions for /cart/, /checkout/ and /my-account/. The store runs in two languages, and the second language uses /de/warenkorb/ as its cart URL. Nobody adds that path to the exclusion list.
For three days, the German cart page comes from cache. Most visitors see an empty cart after adding a product. A few see a cart that holds another visitor's items. The uptime monitor reports 100%, and the English store sells as usual, so total orders fall by about a fifth instead of dropping to zero. That kind of partial drop is easy to miss.
A customer email reports the problem on 19 November. The developer runs the header check against /de/warenkorb/, sees cf-cache-status: HIT, adds the path and the cookie bypass rules, purges the CDN and runs the full test plan in both languages. The fix took 20 minutes; the German cart had been broken for three days before anyone noticed.
/cart/ but forgetting translated slugs, a custom cart page or the cookie bypass rules.This guide covers WooCommerce on WordPress. Shopify and Magento handle carts differently, though the guest test, the network panel and the cache header check apply to any platform. Some managed hosts run server caches you cannot configure yourself, so you may need to send the exclusion list to their support team. Security plugins and WAFs vary too much to cover here; if you see 403 responses, their logs will tell you which rule fired.
You are probably logged in. Many caches skip logged-in users and serve guests a cached copy of the page, which may contain an old nonce or a cached cart. Test in a private window as a guest, on a second device.
No. Keep caching for product and category pages, which carry most of the traffic, and exclude cart, checkout, account pages and add to cart requests. Then run the test plan above after every change.
Most often the cart page or the request after it comes from a cache that ignores the WooCommerce session cookies. Check the cart page headers for a cache HIT and confirm that woocommerce_items_in_cart and wp_woocommerce_session_ cookies trigger a bypass.
A daily manual test catches most add to cart faults, but not the one that appears an hour after you ran it. Pingvera's WordPress connector sends WooCommerce order events in real time, and its anomaly detector compares order flow with an hourly baseline, so you get an alert when the site is up but orders have stopped or fallen. The unified timeline places that drop next to deploys and incidents, so a cache rule change and the hour sales fell show up side by side. Pingvera does not click your button for you; it watches the orders that should follow. For the wider picture, read how to monitor WooCommerce checkout and catching a store that stopped selling.
Last reviewed: 2026-11-18
Pingvera watches whether an online business actually works — uptime, checkout, orders, domain, SSL and server — and alerts you in Telegram, email or a webhook before a customer has to tell you.
Start freeRead next: WooCommerce checkout monitoring: how to catch a dead checkout before the client calls · WooCommerce 11.3 Before Black Friday: What Changed and What to Test.
Read next: PayPal IPN Not Working: Fix Stuck Orders Before Peak · WooCommerce Not Sending Order Emails: Fix It Before Peak · WooCommerce Coupon Not Working? Fix It Before Black Friday · Ecommerce Site Search Optimisation Guide · Run a free site check.