Skip to content

Slow WooCommerce store: how to speed up a large catalogue

· The AYT team · 5 min read

Person tying string around a cardboard parcel on a white table

A WooCommerce store usually gets slow because of the database: thousands of products and orders mean many queries on every page, and the cart, checkout and customer account can't be served from cache. The most common causes are a missing object cache (Redis), orders still kept in WordPress's tables instead of HPOS, scripts that refresh the cart on every page, and heavy plugins.

How to find out why WooCommerce is slow

Measure before you change anything:

  1. Open a category page, a product page and the cart, logged in and logged out. If only the cart and checkout are slow, the problem lies with payments, shipping or checkout plugins. If everything is slow, it's the server or the database.
  2. Install the Query Monitor plugin for a while. For each page it shows how many SQL queries run, how long they take and which plugin makes them.
  3. Look at the number of "Pending" and "Failed" actions under WooCommerce → Status → Scheduled Actions. Tens of thousands of pending actions mean a cron that can't keep up.

For delays that only happen now and then, the PHP error log and the list of slow plugins in your hosting panel are more useful than a one-off test. For a WordPress site's speed in general, see slow WordPress site.

Cause 1: no object cache

WordPress reads the same options, products and settings dozens of times per page. Without a persistent object cache, every visit asks the database again. Redis keeps the results in memory between requests, and the pages that can't be cached (cart, checkout, my account, wp-admin) gain the most.

You switch Redis on in your hosting panel, then activate an object cache plugin in WordPress. The steps are in the guide to Redis object cache for WordPress.

Cause 2: orders still live in wp_posts

On stores started before WooCommerce 8.2, orders may still be stored as posts in wp_posts, with their details in wp_postmeta. With tens of thousands of orders, the metadata table grows to millions of rows and slows down the orders list and product pages. Switching to HPOS moves orders into tables of their own; the process is in the guide to WooCommerce HPOS.

Cause 3: cart fragments

The wc-cart-fragments script sends an AJAX request on every page view to refresh the mini cart in the header. That request can't be cached, so every visitor puts load on the server even on cached pages.

Since WooCommerce 7.8 the script only loads when the Mini Cart widget is used, but some themes build it straight into the header, and some plugins request it as a dependency. Check in Query Monitor (or the browser's Network tab) for ?wc-ajax=get_refreshed_fragments requests. If you see them, replace the widget with WooCommerce's Mini-Cart block or ask the theme for a version without fragments.

Cause 4: scheduled actions have piled up

WooCommerce and many extensions (email marketing, product feeds, invoicing) use Action Scheduler for background tasks. If WordPress cron only runs on visits, actions pile up, and when they do run, many run at once, during someone's visit.

  1. Turn off WP-Cron on visits and set up a real server cron every few minutes; see WordPress cron.
  2. If you have thousands of "Failed" actions from one plugin, fix the cause (usually an expired API key) or disable the plugin.
  3. Completed actions are kept in the database for a while. On large stores you can shorten that:
add_filter( 'action_scheduler_retention_period', function () {
    return WEEK_IN_SECONDS;
} );

Cause 5: oversized autoload options

Options marked "autoload" in wp_options are read on every request. Deleted plugins often leave large data behind here. Check the total in phpMyAdmin:

SELECT SUM(LENGTH(option_value)) / 1024 AS kb
FROM wp_options
WHERE autoload IN ('yes', 'on', 'auto', 'auto-on');

If the total goes above 800 KB (the point where WordPress's Site Health warns, since WordPress 6.6), look at the largest options (ORDER BY LENGTH(option_value) DESC LIMIT 20) and who they belong to. Only delete options of plugins you no longer use, and back up first. Your table prefix may differ from wp_.

Cause 6: catalogue filters

Attribute filters (size, colour, brand) on large categories can produce very slow queries. WooCommerce has a dedicated table for them:

  1. Under WooCommerce → Settings → Products → Advanced, in "Product attributes lookup table", check that "Use the product attributes lookup table for catalog filtering" is ticked.
  2. If filters give wrong results after an import, regenerate the table from WooCommerce → Status → Tools, with "Regenerate the product attributes lookup table".

Filter plugins that build their own indexes are usually faster than the ones that query on every click; test them on staging with your real catalogue.

Cause 7: heavy plugins and too few resources

A store usually runs more plugins than a blog, and one badly written plugin can double the load time. In Query Monitor, sort by duration and see which component makes the most queries. Deactivate suspect plugins on staging, one at a time, and measure again.

If pages still load slowly at peak traffic after all this, the store has probably outgrown the plan's resources (CPU, memory, concurrent PHP processes). The resource graphs in the panel show whether you're hitting the limits.

Your store on AYT

The Site Performance page in the panel

On AYT's plans you switch Redis on from the panel, and the Site Performance page shows slow plugins and resource usage, with email alerts. The web server is nginx, with HTTP/2, HTTP/3 and page caching, and every account runs isolated PHP, with the version chosen per site. You add the real cron job from the Cron Jobs page, and you test optimisations on a staging site first.

More articles

All articles