What the error looks like
On the classic checkout the order fails after Place order with a notice such as "We were unable to process your order, please try again" or "Sorry, your session has expired". The form carries the token in a hidden field named woocommerce-process-checkout-nonce.
On the block checkout the browser talks to the Store API (/wp-json/wc/store/v1/…) and sends the token in a Nonce header. A bad one comes back as woocommerce_rest_invalid_nonce, a missing one as woocommerce_rest_missing_nonce, and the checkout shows a generic error.
"Payment nonce is missing" is a different message with the same word. It comes from card gateways such as Braintree or PayPal, whose script did not return a payment token to the form. That one is a payment-script problem, covered in PayPal Payments problems on WooCommerce.
Why a cache causes it
WordPress nonces are valid for 12 to 24 hours, and for a guest WooCommerce ties them to the shopper’s session cookie. A cached checkout page hands every visitor the token that was generated for whoever loaded the page first. It fails when it gets too old, and it can fail sooner because it belongs to another session.
Cache plugins such as WP Rocket and LiteSpeed Cache leave cart, checkout and my-account out of the cache by default. The usual culprit is a layer above WordPress that does not know about WooCommerce: a hosting page cache (Varnish, nginx FastCGI cache), a Cloudflare "Cache Everything" rule, or a CDN set to cache HTML.
A rule like "cache every HTML page for 4 hours" breaks checkout only for some buyers, at some times. That is why it so often survives testing by the store owner, who is logged in and bypasses the cache.
How to confirm it
curl -sI https://example.com/checkout/ \
| grep -iE "cf-cache-status|x-cache|x-litespeed-cache|^age|cache-control"- Open the checkout in a private window. Logged out, with an item in the cart, the way a buyer sees it.
- Check the response headers. In DevTools → Network, select the
/checkout/document.cf-cache-status: HIT,x-cache: HIT,x-litespeed-cache: hitor a largeagevalue mean the page came from a cache. - Compare tokens. View the page source in two different private windows and search for
woocommerce-process-checkout-nonce. The same value in both means both visitors got one cached page. - Watch the order request. Place the order and look at the
?wc-ajax=checkoutor Store API response. A nonce error there confirms it.
The fix: what to keep out of the cache
| Keep out of the cache | Why |
|---|---|
/cart/, /checkout/, /my-account/ | The pages carry per-session tokens and cart contents |
?wc-ajax=* | Classic checkout, coupons, shipping recalculation |
/wp-json/wc/store/* | Block cart and checkout (Store API) |
Requests with woocommerce_items_in_cart or wp_woocommerce_session_* cookies | A shopper with a cart must never get a shared page |
# nginx FastCGI cache: never cache checkout or a shopper with a cart
set $skip_cache 0;
if ($request_uri ~* "/(cart|checkout|my-account)/|wc-ajax=|/wp-json/wc/store/") {
set $skip_cache 1;
}
if ($http_cookie ~* "woocommerce_items_in_cart|wp_woocommerce_session_") {
set $skip_cache 1;
}
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;(http.request.uri.path contains "/checkout" or http.request.uri.path contains "/cart" or http.request.uri.path contains "/my-account" or http.request.uri.path contains "/wp-json/wc/store" or http.request.uri.query contains "wc-ajax" or http.cookie contains "woocommerce_items_in_cart" or http.cookie contains "wp_woocommerce_session_")Set those exclusions in every layer that caches HTML: the plugin, the host’s cache and the CDN. For Cloudflare that means a Cache Rule that bypasses the cache for those paths and cookies; the details are in Cloudflare and the WooCommerce checkout. Then purge everything, because pages already cached keep their old tokens until they expire.
For speed, cache the product and category pages. They get most of the traffic and carry no checkout token.
Catching it before buyers do
A nonce problem is easy to miss because the page looks fine: the form renders and totals update, and only the final submit fails. A test that stops before Place order will not see it. A test that submits an order as a guest, from outside, will.
MageSentinel walks the WooCommerce checkout as a guest in a real browser on a schedule. With the MageSentinel plugin connected and real test orders turned on, it places the order, reports the step that failed with a screenshot, and the plugin cancels the order afterwards. You can also run the free WooCommerce checkout checker once without signing up. For other reasons Place order fails, see WooCommerce checkout stuck on processing.
Find out your checkout broke before your customers do.
Real checkout checks for Magento and WooCommerce · free plan · no card requiredWooCommerce checkout monitoring →