WooCommerce Cart Shows Empty After Adding Products: Causes and Fixes
Quick Answer: Restoring Items in an Empty WooCommerce Cart
When items added to a shopping cart fail to display or immediately disappear upon visiting the cart page, the issue is typically caused by full-page caching on dynamic endpoints, missing cache bypasses for session cookies, or misassigned cart pages in WooCommerce settings. Static caching layers deliver pre-rendered HTML to site visitors, blocking dynamic PHP session updates required to maintain individual cart contents.

To fix an empty WooCommerce cart, configure your caching plugin, web server, and CDN to exclude /cart/, /checkout/, and /my-account/ from page caching, and bypass the session cookie wp_woocommerce_session_. If the cart remains empty after applying cache exclusions, clear WooCommerce transients and customer sessions in the WordPress admin panel, verify page assignments, and refresh WordPress permalink rewrite rules.
Primary Causes of an Empty Cart in WooCommerce
WooCommerce maintains shopper sessions across page loads using HTTP cookies, database records, and dynamic page rendering. An empty cart typically results from one of the following root causes:
- Full-Page Caching on E-Commerce Pages: Caching the Cart or Checkout pages delivers static HTML rather than executing dynamic PHP templates, hiding newly added cart items.
- Stripped or Cached Session Cookies: If caching layers or reverse proxies block the
wp_woocommerce_session_cookie, WooCommerce cannot pair the visitor's browser with the corresponding cart data stored on the server. - Corrupted Transient or Session Records: Expired or corrupted database transients can prevent WooCommerce from saving and retrieving cart session data properly.
- Incorrect Page Assignment or Missing Shortcode/Block: If the Cart page is unassigned in WooCommerce settings or lacks the core Cart block or
[woocommerce_cart]shortcode, dynamic cart items cannot render. - Plugin or Theme Overrides: Custom themes or third-party extensions overriding WooCommerce cart templates or AJAX endpoints can disrupt session initialization.
Diagnostic Steps to Restore Cart Functionality
1. Exclude Dynamic Pages and Cookies from Caching
Dynamic e-commerce endpoints must bypass page caching entirely so they can render personalized user sessions. According to official WooCommerce caching documentation, exclude the following core pages from your caching plugin, server cache (such as Varnish, Nginx FastCGI, or LiteSpeed), and CDN cache rules:
/cart//checkout//my-account/
Additionally, ensure your caching systems exclude these essential WooCommerce session cookies:
wp_woocommerce_session_(contains a unique customer token used to locate session data in the database)woocommerce_cart_hash(tracks when cart contents and data change)woocommerce_items_in_cart(identifies active cart items)
If your hosting environment or caching solution provides database caching, exclude the prefix _wc_session_ from database cache storage to prevent stale session persistence. For related page rendering issues caused by aggressive caching, review our troubleshooting guide on Elementor changes not showing on live site.
2. Clear WooCommerce Transients and Customer Sessions
Corrupted transient records or stale database entries can cause carts to fail to load. WooCommerce includes built-in maintenance utilities under the System Status menu to clear these records safely.
Navigate to WooCommerce > Status > Tools and run the following maintenance actions:
- WooCommerce transients: Click Clear transients to remove temporary shop and product data.
- Expired transients: Click Clear transients to purge expired temporary records from the database.
- Clear customer sessions: Click Clear to remove active customer cart sessions from the database.
Warning: Running the Clear customer sessions tool will immediately empty active shopping carts for all current site visitors and reset their uncompleted shopping sessions. Run this tool during low-traffic maintenance windows.
3. Verify Page Setup and Block Configuration
WooCommerce requires explicit page assignments to direct add-to-cart actions to the designated endpoint.
- Log in to the WordPress admin dashboard and go to WooCommerce > Settings > Advanced.
- Under the Page setup tab, confirm that Cart page is mapped to your store's Cart page.
- Navigate to Pages > All Pages and open your designated Cart page in the editor.
- Ensure the page contains either the core WooCommerce Cart Block or the legacy
[woocommerce_cart]shortcode. - Click Update to save any page changes.
4. Refresh WordPress Permalinks
Corrupted rewrite rules can disrupt URL routing during dynamic cart interactions. Resaving permalink settings regenerates rewrite rules without modifying your site database.
- Navigate to Settings > Permalinks in the WordPress dashboard.
- Scroll to the bottom of the page without changing any settings.
- Click Save Changes to flush and regenerate the rewrite rules.
5. Run a Plugin and Theme Conflict Test
If cache exclusions and page assignments are verified, an active theme template override or conflicting plugin may be intercepting session cookies or cart AJAX requests.
- Create a complete backup of your WordPress site before running diagnostics.
- Temporarily switch your active theme to a default WordPress theme, such as Storefront or Twenty Twenty-Four.
- Navigate to Plugins > Installed Plugins and temporarily deactivate all plugins except WooCommerce.
- Open a private browsing window, add a product to the cart, and verify that it persists on the cart page.
- Reactivate remaining plugins one by one, testing the cart after each reactivation to pinpoint the conflicting extension.
If your store experiences ongoing checkout failures after resolving cart session issues, follow our walkthrough for WooCommerce checkout stuck loading. If your site encounters severe backend database failures during session writes, consult our guide to resolving a WordPress error establishing a database connection.
Verification Steps
After adjusting cache settings, page configurations, and session tools, verify cart stability across distinct browser sessions:
- Clear your local browser cache and existing site cookies.
- Open a new incognito or private browsing session.
- Visit your store catalog, select a product, and click Add to cart.
- Navigate to
/cart/and verify that product line items, quantities, and totals render correctly. - Refresh the cart page multiple times to confirm the session remains active without dropping products.
- Proceed to
/checkout/to confirm the items transition seamlessly to the checkout stage.