WooCommerce Performance: Optimizing Large Product Catalogues, Queries and Checkout

Why an ecommerce site cannot be cached like a blog, and how to optimize product queries as the catalogue grows without breaking checkout.

In short

WooCommerce is WordPress with one additional constraint that changes everything: an online shop cannot be cached like a blog.

A blog is the same for everyone, so you cache the page and serve it to thousands. A shop has a cart, an account, a checkout and often per-customer pricing — all of which must be different for every visitor. So caching becomes a per-page-type decision rather than a site-wide switch, and getting it wrong does not make the site slow, it makes it wrong: one customer seeing another's cart.

The three things that actually slow WooCommerce stores:

  1. Product queries that do not scale — fine at 100 products, painful at 10,000.
  2. Cart fragments, an AJAX request fired on every page view by default.
  3. Everything running everywhere — Woo's scripts loading on pages with no commerce on them.

Start with the WordPress guide for caching, plugins and the database. This covers what is different because it is a shop.

Caching, by page type

This table is the core of WooCommerce performance. Treat it as a specification.

Page typePage cacheNotes
Home, category, productYesThe big win. Same for everyone, unless you have per-customer pricing.
Blog, content pagesYesAs any WordPress site.
CartNeverPer visitor by definition.
CheckoutNeverPer visitor, and correctness matters far more than speed.
My AccountNeverPersonal data.
Order received / thank youNeverContains order details.
Search and filtered listingsCarefullyCacheable, but query-string variations can fragment the cache badly.
AJAX endpoints (admin-ajax.php, Store API)NeverDynamic by nature.

Two refinements that matter:

Logged-in customers generally need to bypass the page cache, or at minimum be served a separate cached variant. Serving a logged-out cached page to a logged-in customer breaks their session display.

Per-customer pricing — wholesale tiers, B2B accounts, currency by region — makes product pages personalised too. If you have it, your cacheable surface is much smaller, and you should lean harder on object caching instead.

Object caching matters more on WooCommerce than on a content site precisely because so many pages cannot be page-cached. It makes the uncacheable pages cheaper to build.

Cart fragments

WooCommerce keeps the cart total in your header up to date by firing an AJAX request through admin-ajax.php. By default this happens on every page view, it bypasses page caching, and it hits PHP and the database each time.

On a busy store this is frequently the single largest source of server load, and most visitors never see the cart change on the page they are reading.

The options, in order of safety:

Load fragments only where the cart can change. Product and cart pages need them; a blog post does not.

Use a cached cart count rendered server-side, accepting that it may be briefly stale on cached pages.

Disable fragments and update the cart on navigation. Simplest and most robust, and it means the header count updates when the visitor moves rather than instantly.

// Load cart fragments only where the cart can actually change.
add_action( 'wp_enqueue_scripts', function () {
    if ( is_product() || is_cart() || is_checkout() ) {
        return;
    }
    wp_dequeue_script( 'wc-cart-fragments' );
}, 100 );

Stop Woo loading everywhere

By default WooCommerce enqueues its styles and scripts across the whole site, so a blog post loads commerce assets it has no use for.

// Remove WooCommerce styles and scripts outside commerce pages.
add_action( 'wp_enqueue_scripts', function () {
    if ( is_woocommerce() || is_cart() || is_checkout() || is_account_page() ) {
        return;
    }
    wp_dequeue_style( 'woocommerce-general' );
    wp_dequeue_style( 'woocommerce-layout' );
    wp_dequeue_style( 'woocommerce-smallscreen' );
    wp_dequeue_script( 'wc-add-to-cart' );
    wp_dequeue_script( 'woocommerce' );
}, 100 );

Be careful if your theme or a plugin shows products in widgets, related-product blocks or shortcodes on non-commerce pages — those need the assets. Check every template after changing this.

Product queries at scale

This is what makes a store that was fine last year slow this year.

Variable products multiply work. A product with 50 variations means many more rows and more work to resolve availability and price ranges. A category page showing 24 such products is doing considerably more than 24 products' worth of querying.

Product attributes and meta are query-heavy by nature. WooCommerce maintains lookup tables to make filtering and sorting cheaper — make sure yours are present and populated, since a missing or stale lookup table pushes queries back onto slower paths.

Order storage. WooCommerce's high-performance order storage keeps orders in dedicated tables rather than the posts table. On stores with large order histories this materially improves admin and order-related queries. Check which storage your store uses and plan a migration if it is still on the legacy layout — test on staging, because some older extensions assume the old structure.

Keep the catalogue tidy. Expired product meta, orphaned variations and old transients accumulate. Scheduled maintenance, not emergency cleanup.

Find the actual slow queries rather than guessing: enable the slow query log, and use a query monitoring plugin to see counts and durations per page. Compare a category page with a static page — the difference names your problem.

The checkout is a correctness zone

The standard performance toolkit is partly unavailable at checkout, and that is correct.

Never cache it. Never defer scripts it depends on. Never remove a script that payment, fraud checking, tax calculation or consent relies on without the owner agreeing and testing.

What you can safely do:

  • Reduce the number of fields to those you genuinely need.
  • Remove plugins that add fields or scripts you do not use.
  • Make sure object caching is working, so the queries behind checkout are cheaper.
  • Keep third-party scripts off the checkout unless they are required there.

And a hard rule: complete a real test order after every change that touches scripts, caching or plugins. Every payment method you offer. A checkout that is 200 ms faster and fails one order in a hundred is a catastrophe dressed as an improvement.

Product images

Product media is the other half of ecommerce performance. WooCommerce generates several image sizes on upload; the common problems are themes requesting the wrong one, originals uploaded at camera resolution, and galleries loading every image at full size.

The rules are in image optimization and lazy loading. The store-specific points: make the first gallery image eager and prioritised, lazy-load the rest, request thumbnails at thumbnail size, and set an upload limit the people adding products know about.

Common mistakes

Caching cart, checkout or account pages. The dangerous one.

Serving logged-in customers from the logged-out cache.

Leaving cart fragments on every page.

Dequeuing Woo assets without checking product widgets on other templates.

Deferring a checkout script.

Assuming a bigger server fixes slow product queries. It makes the same query slightly faster.

Testing with 20 products and deploying to a store with 20,000.

Not completing a test order after every relevant change.

Running an aggressive optimisation plugin on checkout.

Verification

  1. Confirm the cache exclusions, by requesting cart and checkout and checking the response is not cached.
  2. Browse as two different logged-in customers and confirm neither sees the other's cart or details. Non-negotiable.
  3. Measure a category page cold and warm, median of five runs, and compare query counts before and after.
  4. Test at realistic catalogue size, on staging with production data.
  5. Test the full purchase flow — browse, filter, add to cart from both product and category pages, apply a coupon, check out, with every payment method.
  6. Confirm the cart count updates where customers expect it.
  7. Check order emails and webhooks still fire.
  8. Then watch field data and conversion rate for four weeks. Conversion is the number that matters here.

When it still does not improve

  • Category pages still slow with caching on → they may be excluded by a query-string rule, or the cache is fragmenting on filter parameters.
  • Fast for guests, slow for logged-in customers → expected, since they bypass the page cache. Object caching is the fix, not more page caching.
  • Queries still high after cleanup → look at variations and attribute filtering, and confirm lookup tables are populated.
  • Checkout is slow and you cannot cache it → correct, and the fix is fewer queries and fewer scripts, not caching.
  • It got faster and conversion fell → something broke. Check the cart count, add-to-cart from every template, and every payment method, immediately.
  • Admin is slow but the storefront is fine → often order storage on large stores. Check which storage layout you are using.

Keeping a store fast

Stores decay through growth: more products, more orders, more plugins, more marketing tags.

Four habits: re-measure a category page whenever the catalogue grows materially; run database maintenance on a schedule; review plugins and tags quarterly; and keep the cache exclusion list written down and reviewed when new routes appear — because the next person to add a page that shows personal data will not know the rule unless it is written somewhere.

Frequently asked questions

Why is WooCommerce slower than regular WordPress?

Because a shop cannot be cached like a blog. Cart, checkout and account pages are per visitor by definition, so caching becomes a per-page-type decision. Add product queries that scale poorly, cart fragments firing on every page view, and Woo assets loading site-wide.

Which WooCommerce pages should not be cached?

Cart, checkout, My Account, order received, and any AJAX endpoint — all per visitor. Home, category, product and content pages are cacheable unless you have per-customer pricing. Logged-in customers generally need to bypass the page cache entirely.

What are WooCommerce cart fragments and should I disable them?

An AJAX request that keeps the header cart total current. By default it fires on every page view, bypasses page caching and hits PHP and the database each time, which on a busy store is often the largest source of load. Load it only where the cart can change, and test the add-to-cart flow thoroughly afterwards.

How do I make WooCommerce faster with thousands of products?

Object caching so uncacheable pages are cheaper to build, confirm the product lookup tables are present and populated, check variable products are not multiplying queries on category pages, read the slow query log rather than guessing, and run database maintenance on a schedule.

Can I optimise the WooCommerce checkout?

Carefully, and correctness comes first. Never cache it, never defer scripts it depends on, never remove a script without the owner confirming what it does. What is safe: fewer fields, removing plugins that add unused scripts there, and working object caching.

Why did my conversion rate drop after optimising my store?

Something broke. Check the header cart count updates, add-to-cart from both product and category pages, every payment method, and that order emails and webhooks still fire. Assume you broke something until you have proved otherwise.

References