WooCommerce Performance at Scale

How to keep WooCommerce fast under heavy traffic, large catalogs and big order tables.

  • WooCommerce slows down where page caching can't help: cart, checkout, admin, and the database. Product and category pages cache fine; focus optimization on everything else.
  • HPOS (High-Performance Order Storage) is the biggest single improvement for stores with large order histories. It's the default since WooCommerce 8.2, but older stores must migrate.
  • Migrate to HPOS safely: check plugin compatibility on staging, enable compatibility mode, run `wp wc hpos sync` and `verify_cot_data`, switch storage, then disable compatibility mode after 1-2 weeks to get the write-speed gain.
  • After HPOS, custom code using get_post_meta/update_post_meta, WP_Query with 'shop_order', or direct SQL on wp_posts/wp_postmeta for orders will break. Use the order API instead: wc_get_order(), wc_get_orders(), $order->get_meta(), update_meta_data() and save().
  • Safe database cleanup: clear customer sessions (off-peak), delete expired transients, shorten Action Scheduler log retention, and regenerate (never delete) product lookup tables.
  • Avoid bulk cleanup plugins, SQL order deletion, or 'orphaned' postmeta removal without a backup and staging test. Order data spans several tables and partial deletes cause more problems than they solve.
  • Checkout timeouts happen when slow uncached requests exhaust PHP workers. Fixes: short timeouts on outside API calls (shipping, tax, fraud, CRM), moving non-essential work to background actions, deferring emails and webhooks, and adding enough PHP workers.
  • Block or rate limit bots hitting ?add-to-cart= links at the edge, since each creates a session and bypasses the cache. Use a Redis or Memcached object cache to cut repeated database lookups.
  • For a slow admin with thousands of products, use Query Monitor to find the cause. Common culprits: plugin-added list columns running per-row queries, high rows-per-page settings (reset to 20), stale lookup tables, orders still in postmeta, unused dashboard widgets and analytics, and bloated autoloaded options.

WooCommerce slows down where caching can’t help: cart, checkout, the admin and the database.

If you want WooCommerce to stay fast with heavy traffic, a large catalog or a big order history, work on the parts a page cache never touches. Product and category pages can be cached. Everything below can’t.

Where It Slows Down

Area Why Caching Doesn’t Help Usual Cause
Cart & checkout Every request is unique to the customer. Sessions table, slow plugin hooks, outside API calls
Admin Never cached. Order and product list queries, extra list columns
Database Under everything. Orders in wp_postmeta, sessions, scheduled action logs
Filtering & search Too many combinations to cache. Meta queries across the catalog

HPOS Migration

High-Performance Order Storage moves orders out of wp_posts and wp_postmeta into their own indexed tables (wp_wc_orders, wp_wc_order_addresses, wp_wc_order_operational_data, wp_wc_orders_meta). It’s the default for new stores since WooCommerce 8.2. Older stores have to migrate, and it’s the biggest single improvement for a store with a large order history.

  1. Go to WooCommerce > Settings > Advanced > Features. It lists any active plugin that hasn’t declared HPOS support.
  2. Update or replace those plugins on a staging copy first.
  3. Turn on compatibility mode, which keeps both sets of tables in sync.
  4. Run the sync and verify it:
wp wc hpos sync
wp wc hpos verify_cot_data
wp wc hpos status
  1. Switch order storage to HPOS, with compatibility mode still on.
  2. Run for a week or two, then turn compatibility mode off. That’s when the write speed gain shows up.

What Breaks

  • Code that reads orders with get_post_meta( $order_id, ... ) or update_post_meta().
  • WP_Query or get_posts() with post_type => 'shop_order'.
  • Direct SQL against wp_posts and wp_postmeta for order data, common in custom reports and exports.
  • Admin customizations hooked to the old order edit screen.

The fix is to use the order API, which works with both storage types:

$order = wc_get_order( $order_id );
$value = $order->get_meta( '_my_field' );
$order->update_meta_data( '_my_field', 'value' );
$order->save();

$orders = wc_get_orders( array(
	'status' => 'processing',
	'limit'  => 50,
) );

Safe Database Cleanup

What How Notes
Customer sessions WooCommerce > Status > Tools > Clear customer sessions Empties active carts. Run it off peak.
Expired transients wp transient delete --expired Always safe.
Scheduled action logs Lower the retention period (30 days by default) Completed actions pile up fast on busy stores.
Product lookup tables Tools > Regenerate the product lookup tables Regenerate. Don’t delete.
add_filter( 'action_scheduler_retention_period', function () {
	return 7 * DAY_IN_SECONDS;
} );

What I don’t touch without a backup and a staging test: deleting orders with SQL, “orphaned” postmeta, and anything a cleanup plugin offers to remove in bulk. Order data is spread across several tables and a partial delete causes more problems than it solves.

Checkout Timeouts Under Load

Checkout fails under load when uncached requests use up every PHP worker. Each slow checkout holds a worker, the queue grows, and requests time out.

  • Outside API calls during checkout. Live shipping rates, tax lookups, fraud checks and CRM syncs all run while the customer waits. Give each a short timeout, and move anything that doesn’t have to finish before the order is placed into a background action.
  • Bots creating carts. Crawlers hitting ?add-to-cart= links create a session each time and skip the cache. Block or rate limit those URLs at the edge.
  • No object cache. Redis or Memcached takes repeated option, session and product lookups off the database.
  • Too few PHP workers for the number of uncached requests at peak.
  • Order emails and webhooks sent inline. Defer them.

I go through the session side in WooCommerce cart session performance, and the edge setup in Cloudflare caching for WordPress.

Slow Admin With 8,000 Products

Install Query Monitor and load the slow screen. The cause is nearly always visible in the query list.

  • Extra list columns. Plugins add columns to the product and order lists, and each one can run a query per row. Hide them in Screen Options, or remove the plugin’s column.
  • Rows per page. Set Screen Options back to 20. Someone usually raised it to 200.
  • Stale lookup tables. Sorting and filtering by price, stock or SKU uses wp_wc_product_meta_lookup. Regenerate it if it’s out of date.
  • Orders still in postmeta. The order list and order search are far faster on HPOS.
  • Dashboard widgets & analytics. Turn off the ones nobody reads.
  • Autoloaded options. Old plugins leave large autoloaded rows that load on every request.
wp db query "SELECT option_name, LENGTH(option_value) AS size FROM wp_options WHERE autoload IN ('yes','on','auto','auto-on') ORDER BY size DESC LIMIT 20"