Home/Blog/How to Fix WooCommerce Cart Emptying / Cart Page 404

How to Fix WooCommerce Cart Emptying / Cart Page 404

WooCommerce cart empties and cart page 404 fix

A customer adds products to the cart, clicks through โ€” and the cart is mysteriously empty. Or the cart page itself throws a 404. Either way, the sale is gone. This WooCommerce cart empty 404 fix guide covers both problems: why carts empty themselves (cookies and caching) and why the cart page 404s (page assignment), with six fixes that restore a working cart.

What Causes Cart Emptying / Cart Page 404

These are two related problems with different roots. Cart emptying means session data is being lost; cart page 404 means WooCommerce can’t find its cart page. Common causes of both:

  • Cached cart/checkout pages: the #1 cause of empty carts. Cart, checkout, and account pages display dynamic content and must never be cached โ€” a cached cart page shows a stale, empty cart.
  • Cookies blocked or misconfigured: WooCommerce stores cart data in cookies (woocommerce_cart_hash, woocommerce_items_in_cart). Blocked cookies, wrong COOKIE_DOMAIN, or an SSL/HTTPS mismatch empties the cart after every page load.
  • Session expiration: WooCommerce cart sessions expire; shoppers who return days later find an empty cart. Extending session persistence (e.g. 30 days under Accounts & Privacy) or a persistent-cart plugin helps.
  • Cart page not assigned or deleted: the cart page was trashed, set to draft, or never assigned in WooCommerce โ†’ Settings โ†’ Advanced โ†’ Page Setup โ€” hence the 404.
  • Missing Cart block/shortcode: the page exists but no longer contains the Cart block or [woocommerce_cart] shortcode, so it renders blank.
  • Theme/plugin conflicts and stale endpoints: a theme breaking cart scripts, a security plugin blocking WooCommerce AJAX, spaces in checkout endpoint URLs, or stale permalinks. More store guides live on the KamiWeb blog.

How to Fix Cart Emptying / Cart Page 404

First, check WooCommerce โ†’ Status for red alerts โ€” confirm the WC Pages are correctly set, the cart page contains the right shortcode/block, and there are no outdated template overrides. Then work through these fixes with our free web tools handy.

Browser cookie settings with shopping cart concept

  1. Reassign or regenerate the cart page (404 fix). Go to WooCommerce โ†’ Settings โ†’ Advanced โ†’ Page Setup and assign the correct Cart page. If the page is missing, regenerate it via WooCommerce โ†’ Status โ†’ Tools (“Create default WooCommerce pages”). Open the page in the editor and confirm it contains the Cart block or [woocommerce_cart] shortcode, then save.
  2. Flush permalinks. Go to Settings โ†’ Permalinks and click Save Changes without changing anything. This flushes rewrite rules and often resolves cart/checkout 404s immediately.
  3. Exclude cart pages from all caching. In your caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache), exclude /cart/, /checkout/, and /my-account/ from caching. On Cloudflare, create a page rule bypassing cache for cart pages. Ask your host about server-side caches (Varnish, Nginx) โ€” they can override plugin settings. Then clear browser cache and test in a private window.
  4. Fix cookies and HTTPS. Check in DevTools โ†’ Application โ†’ Cookies that the WooCommerce cookies exist. Allow cookies for your domain, ensure the whole store runs on consistent https:// (update siteurl/home in wp_options if needed), and force secure checkout in WooCommerce โ†’ Settings โ†’ Advanced. If needed, add define('COOKIE_DOMAIN', ''); and define('COOKIEPATH', '/'); to wp-config.php.
  5. Clear sessions and check conflicts. Under WooCommerce โ†’ Status โ†’ Tools, click “Clear customer sessions” โ€” this alone fixes many cart weirdness cases. Then check WooCommerce โ†’ Settings โ†’ Advanced โ†’ Checkout Endpoints for stray spaces in endpoint URLs. Temporarily switch to Storefront and deactivate plugins (except WooCommerce) to isolate conflicts; security plugins like Wordfence may be blocking WooCommerce AJAX.
  6. Extend session persistence. If carts empty for returning shoppers, go to WooCommerce โ†’ Settings โ†’ Accounts & Privacy and extend session persistence (30 days is reasonable for most stores). For logged-in shoppers, a persistent-cart plugin ties cart data to the user account so it survives across sessions. Browse KamiWeb’s plugin resources for store tools.

Conclusion

The WooCommerce cart empty 404 fix splits cleanly: 404s mean reassigning the cart page and flushing permalinks; emptying carts mean un-caching dynamic pages and fixing cookies/HTTPS. Check WooCommerce โ†’ Status first, then work the list โ€” and your cart will hold items all the way to checkout. More fixes at KamiWeb.