Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting · Troubleshooting

How to Fix an Empty WooCommerce Cart in WordPress

Short answer

An empty WooCommerce cart after adding a product is usually caused by a cached cart page or a session cookie that did not survive the page change. Exclude the cart, checkout and account pages from every cache layer, confirm the right page is set as the cart page, and check that the session cookie is set. If the cart still empties, run a plugin conflict test.

Key takeaways

  • A cached cart page shows an old, empty copy of the cart instead of the shopper's real cart.
  • WooCommerce links a guest cart to the browser with a session cookie, so a lost cookie means a lost cart.
  • The cart page must hold the Cart block or the [woocommerce_cart] shortcode to show items.
  • Stores started after WooCommerce 8.3 use Cart and Checkout blocks by default.
  • A conflict test with a default theme finds plugins that break the add to cart step.

What does an empty WooCommerce cart mean?

It means WooCommerce could not match the shopper's browser to the cart stored on the server when the cart page loaded.

WooCommerce keeps the cart on the server and links it to the browser with a session cookie. If that cookie is missing or blocked, the cart page has nothing to show. A cached copy of an empty cart page gives the same blank result for a different reason.

WooCommerce's performance guide says dynamic content such as cart and checkout pages must remain uncached, because a stored copy cannot show one shopper's own cart (How to optimize performance for WooCommerce stores).

Why does the cart empty after adding a product?

The most common causes are a cached cart page, a lost session cookie, the wrong page set as the cart page, and a plugin that breaks the add to cart step.

  • Cached cart page: a cache layer serves a copy made when the cart was empty.
  • Lost session cookie: the browser cookie that points to the cart is blocked or set for another address.
  • Wrong cart page: the page assigned as the cart page has no Cart block or shortcode.
  • Plugin conflict: a plugin changes the add to cart request or clears the session.
  • Mixed addresses: the store loads on both http and https, or with and without www, so the cookie set on one address is not sent on the other.
What you seeLikely causeFirst check
Cart empties on reloadCached cart pagePurge the cache and exclude /cart/
Cart empties after loginSession cookie lostCheck cookies in DevTools
Cart empties at checkoutCached checkout pageExclude /checkout/ from the cache
Add to cart does nothingPlugin or theme conflictRun a conflict test
Items vanish in one browser onlyExtension blocking cookiesTry a clean browser profile

WooCommerce's server recommendations ask for HTTPS support and a WordPress memory limit of 256 MB or more, so a store still on plain http is already outside the recommended setup (WooCommerce Server Recommendations).

How do you check the cart page is set up right?

Open WooCommerce > Settings > Advanced > Page setup and confirm the page listed as Cart is the page shoppers actually see.

Open that page in the editor. It must hold the Cart block or the [woocommerce_cart] shortcode. WooCommerce's cart and checkout guide says the Cart block is the main part of the cart template, showing items, totals, shipping and checkout options (Customizing the Cart and Checkout Pages).

Stores started after WooCommerce 8.3, released in November 2023, use the Cart and Checkout blocks by default, so older stores may still use the shortcode version (Customizing the Cart and Checkout Pages). If the page holds neither the block nor the shortcode, add the Cart block and save.

If the button itself does nothing when clicked, the fault is earlier in the flow, and the steps in How to Fix A Broken Add to Cart Button in WooCommerce apply first.

How do you exclude the cart from caching?

Exclude the Cart, Checkout and My Account pages from page caching in every cache layer: the caching plugin, the host cache, and the CDN.

WooCommerce's performance guide names WP Rocket, W3 Total Cache and WP Super Cache as caching plugins, and says some include built-in WooCommerce support (How to optimize performance for WooCommerce stores). Check the exclusion list in each one rather than trusting the default.

  1. In the caching plugin, add /cart/, /checkout/ and /my-account/ to the never-cache list.
  2. Ask the host to apply the same exclusions to server-level caching.
  3. Apply the same exclusions in the CDN cache rules.
  4. Purge every cache, then add a product and reload the cart.

WooCommerce's performance guide also lists Varnish, NGINX FastCGI Cache and Redis as server-level caching options, so check the host panel for one of those before assuming the plugin is the only layer (How to optimize performance for WooCommerce stores).

LiteSpeed users can set the exclusions in the right place by following What Are the Best LiteSpeed Cache Settings for WooCommerce?.

Open the shop in a private browser window, add a product, then open DevTools and look for the WooCommerce session cookie.

In Chrome, press F12, open Application > Cookies, and look for a cookie starting with wp_woocommerce_session_ plus woocommerce_items_in_cart and woocommerce_cart_hash. If none appear after adding a product, the cookie is blocked or the add to cart request failed.

Try the same steps in a second browser with no extensions. If the cookie appears there, an extension or a privacy setting in the first browser is blocking it. If it appears in neither, the problem is on the server side.

WordPress.org's requirements page asks for PHP 8.3 or greater, MariaDB 10.11 or greater or MySQL 8.4 or greater, and HTTPS support, so an old server stack is worth ruling out while you check cookies (Requirements).

The PHP project lists security fixes for PHP 8.3 until 31 December 2027 and for PHP 8.4 until 31 December 2028 (Supported Versions).

How do you rule out a plugin or theme conflict?

Run a conflict test: switch to a default theme, deactivate all plugins except WooCommerce, and check whether the cart keeps its items.

WooCommerce's conflict guide gives the same order: update everything first, switch to a default theme such as Twenty Twenty-Five or Storefront, then deactivate all plugins except WooCommerce (How to test for plugin and theme conflicts). If the cart works in that clean state, reactivate plugins one at a time until the cart empties again.

Do this on a staging copy when the store is live, or use the Health Check & Troubleshooting plugin, which limits the changes to your own session. The plugin is free on WordPress.org (Health Check & Troubleshooting).

The full isolation method is covered in How to Fix Plugin Conflicts in WordPress.

What if the cart empties only at checkout?

If the cart holds items until checkout and then empties, the session is being lost between the two pages, often by a cached checkout page or a payment plugin.

Read the exact message. “Sorry, your session has expired” means WooCommerce found an empty cart when the checkout form was sent. Treat it as a cart problem, not a payment problem, and repeat the cache and cookie checks for the checkout page.

Open WooCommerce > Status to check the versions and any red warnings. The report is explained in How Do You Read the WooCommerce Status Report?.

How do you confirm the fix worked?

Add a product as a logged-out shopper, reload the cart page, move to checkout, and confirm the item is still there at each step.

  • The cart count in the header matches the cart page.
  • A reload of the cart page keeps the items.
  • The checkout page shows the same items and totals.
  • A second browser session shows its own cart, not the first shopper's.

Repeat the run after purging every cache once more. A fix that only works until the next cache purge was not a fix.

WooCommerce 11.3.1 was released on 19 November 2026, so update to the latest release before you call the cart fixed, because a newer release can change cart and checkout behavior (WooCommerce).

What mistakes should you avoid?

Do not clear all customer sessions as a first step, do not edit the database by hand, and do not test fixes on the live store during busy hours.

  • Clearing sessions empties every shopper's cart, so use it only at a quiet time.
  • Editing session rows by hand can corrupt the cart data for every shopper.
  • Deactivating plugins one by one on the live store can break checkout for real customers.
  • Fixing the plugin cache but forgetting the CDN or host cache leaves the fault in place.

If a change does not show on the live site after you fix it, the steps in How to Fix Changes Not Showing on the Live Site in WordPress cover stale caches in each layer.

Frequently asked questions

Can a caching plugin break the WooCommerce cart?

Yes. If a caching plugin stores a copy of the cart page made when the cart was empty, every shopper sees that empty copy. Exclude the cart, checkout and account pages from caching in the plugin, the host cache and the CDN, then purge all caches and test again.

Why does my WooCommerce cart empty when I log in?

Logging in can replace the guest session with a customer session, and if the session cookie does not carry over, the cart is lost. Check that the site uses one address only, with https and either www or non-www, and that cookies are not blocked in the browser.

Does WooCommerce store the cart in a cookie or the database?

WooCommerce stores the cart data on the server and keeps only a pointer to it in the browser, in a session cookie. That is why clearing cookies or blocking them empties the cart even though the cart data still exists on the server for a short time.

How do I clear WooCommerce sessions safely?

Use WooCommerce > Status > Tools and run the clear sessions tool at a quiet time, because it empties every shopper's cart on the store. Take a backup first, warn the team, and test the cart right after so you can confirm shoppers can add products again.

Can the theme cause an empty WooCommerce cart?

Yes. A theme that overrides WooCommerce templates with old copies, or that loads its own add to cart script, can break the cart. Switch to Storefront or a default WordPress theme briefly; if the cart works there, the theme is involved and needs an update or a fix from its author.

Sources

  1. How to optimize performance for WooCommerce stores WooCommerce Developer Docs
  2. Customizing the Cart and Checkout Pages WooCommerce
  3. How to test for plugin and theme conflicts WooCommerce
  4. WooCommerce Server Recommendations WooCommerce
  5. Requirements WordPress.org
  6. Health Check & Troubleshooting WordPress.org
  7. Supported Versions PHP

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test