To speed up WooCommerce checkout, you must disable or optimize wc-ajax=get_refreshed_fragments, clean up transient database bloat, implement Redis object caching, and defer non-critical third-party scripts. Standard caching plugins bypass checkout pages to prevent session conflicts, leaving database bottlenecks and unoptimized scripts unhandled.
Over the past decade working on ecommerce development projects, I have seen hundreds of online stores lose revenue simply because their cart and checkout pages took more than three seconds to process. Below is a structured, technical guide on diagnosing and resolving checkout latency.
1. Eliminate or Optimize WooCommerce Ajax Cart Fragments
One of the most frequent causes of a slow cart and checkout experience is the default WooCommerce Ajax cart fragment script (wc-ajax=get_refreshed_fragments). This script fires on page load to update the mini-cart icon in your header across non-cached requests.
Every time a user visits a page or refreshes the cart, an admin-ajax request triggers a full WordPress load and database query. On high-traffic sites, this creates massive server overhead.
How to fix it:
- Disable Cart Fragments on non-ecommerce pages: If your site uses static mini-carts, dequeue the script on blog posts or homepage pages using custom PHP in your child theme's
functions.phpor a snippet plugin. - Use modern WooCommerce cart blocks: Upgrading to block-based cart and checkout interfaces completely eliminates the legacy cart fragments script.
If you are using heavily customized themes or legacy setups where cart fragments cannot be removed, consider moving to a high-performance environment like AWS with Hestia CP to handle concurrent PHP processes smoothly.
2. Resolve WooCommerce Database Optimization and Transient Bloat
WooCommerce relies heavily on the wp_options table to store transients, session data, and background jobs. Over time, expired transients, customer cart sessions, and orphan auto-drafts swell the database, leading to a slow WooCommerce admin panel and delayed database responses during checkout.
Key steps for database cleanup:
- Clean expired transients: Transients store temporary cached data, but WooCommerce frequently leaves behind expired records. Run SQL queries or WP-CLI commands to clear them safely.
- Clean up `wp_woocommerce_sessions`: High-traffic stores often accumulate millions of old cart session rows. Safely truncate expired sessions to free up database indexes.
- Optimize autoloaded data: Inspect your
wp_optionstable for autoloaded options (autoload = 'yes'). Aim to keep total autoloaded data under 800 KB.
For complex store setups, choosing between modular plugins or custom coding is crucial for database health. Read my guide on WordPress vs custom development to understand how database architecture impacts performance.
3. Implement Redis Persistent Object Cache
Because cart and checkout pages contain dynamic, customer-specific data, standard page caching (like Nginx FastCGI or caching plugins) must be bypassed. Without page caching, every user action hits your MySQL database directly.
Redis (Remote Dictionary Server) solves this by storing database query results in memory (RAM). When a customer updates their cart, Redis serves repeated database queries instantly without taxing MySQL.
Setting up Redis for WooCommerce:
- Install Redis server on your hosting instance.
- Use a dedicated object cache plugin (e.g., Redis Object Cache).
- Add dynamic salt keys to
wp-config.phpto prevent session leaks between different shoppers.
Properly configuring server-level caching is a standard part of our WordPress development services.
4. Defer Third-Party Tracking Scripts and Unused Assets
Checkout pages are notorious for running heavy analytics, pixels, and payment gateway scripts (e.g., Google Tag Manager, Meta Pixel, Stripe, PayPal). Loading these synchronously delays page interactive time.
Optimization protocol:
- Defer non-essential scripts: Ensure tracking tags do not block DOM rendering. Move scripts to load after DOMContentLoaded or use Web Workers.
- Disable unnecessary plugins on cart/checkout: Use asset management tools to unload review plugins, related product scripts, and live chat widgets on the checkout page.
- Optimize Payment Gateway JS: Ensure payment gateway scripts (like Stripe SDK) only execute when the checkout form is initialized.
If your site speed issues stem from heavy page builders, learn more about optimizing or rebuilding layouts in my post on custom website development.
5. Address WooCommerce Slow Admin Panel Fixes
Store managers often notice that when checkout is slow, the backend order management panel is equally sluggish. A slow WooCommerce admin panel fix involves controlling background heartbeat calls and optimizing database queries.
- Limit the WordPress Heartbeat API: Modify the Heartbeat API interval to 60 seconds or disable it entirely in the admin backend when editing products or processing orders.
- Disable Action Scheduler bloat: Check the
wp_actionscheduler_logstable. If millions of completed or failed background tasks remain, clear them and configure automatic cleanup schedules.
Frequently asked questions
Why is my WooCommerce checkout page so slow compared to product pages?
Product pages can be statically cached by server plugins or CDNs. Checkout pages contain unique session data, bypassing page caching completely. This forces the server to process fresh PHP requests and MySQL database queries for every user action.
Does disabling Ajax cart fragments break my store's functionality?
Disabling cart fragments stops automatic AJAX updates for mini-cart icons on non-ecommerce pages. If your mini-cart relies on this feature, you should replace it with WooCommerce Cart Blocks or update the cart counter via JavaScript on item addition.
How does Redis object caching improve WooCommerce checkout speed?
Redis stores dynamic database query responses in RAM rather than pulling them from the disk-based MySQL database repeatedly. This reduces server load and speeds up cart processing time without caching customer-specific HTML.
Will optimizing my WooCommerce database delete active customer carts?
If done correctly, database optimization only deletes expired transients and old sessions. Active customer sessions stored in wp_woocommerce_sessions remain intact, keeping active user carts safe.
If your WooCommerce store is suffering from slow checkout load times and cart abandonment, visit /lets-talk to discuss a technical performance audit.