Skip to content

WordPress WooCommerce variations — performance gotchas at scale

WordPress WooCommerce variable products with 100+ variations cause admin-list timeouts and front-end slowness. The schema, the queries to audit, and the fix.

A WordPress WooCommerce store sells custom-printed t-shirts. The product has 4 sizes, 12 colors, 3 fabrics, 2 fits — 288 variations on one product. The admin product edit screen now takes 35 seconds to load. The single-product page loads slowly because the variation form initializes JS for all 288. The “Out of stock” warnings on certain variations are six hours stale because the variation-level stock query is hitting a cold cache every time. Variable products are powerful and they punish you at scale.

What’s happening

A WooCommerce variable product creates a product post and one product_variation post per combination. Each variation has its own _stock, _price, _sku, and _visibility meta. For 288 variations, that’s 288 posts and roughly 3,000 postmeta rows for a single product.

The slow points:

  1. Admin product edit screen. The variations panel loads all variations via AJAX in batches of 10. For 288 variations, that is 29 sequential AJAX calls, each loading the variation HTML editor.
  2. Front-end variation form. WooCommerce injects all variation data as a JSON array (wc_data) into the page. For 288 variations this can be 200KB+ of inline JSON, blocking parse and increasing TTFB.
  3. Variations transient cache. The _transient_wc_var_prices_<product_id> transient stores computed min/max prices. On a high-variation product this transient can be 50KB and gets regenerated on any variation update.
  4. _product_attributes serialized blob. WooCommerce stores the attribute structure as a serialized PHP array in postmeta. For products with many attributes, the unserialize cost is non-trivial.
  5. Variation lookup table. WooCommerce 3.6+ added wp_wc_product_meta_lookup for faster filtering. If not populated correctly (after a migration), filtering by attribute is very slow.

How to verify

# How many variations per product? Find the worst offenders.
wp db query "SELECT post_parent, COUNT(*) AS variations
  FROM wp_posts
  WHERE post_type='product_variation' AND post_status='publish'
  GROUP BY post_parent
  ORDER BY variations DESC
  LIMIT 20"

# Total variations across all products
wp db query "SELECT COUNT(*) FROM wp_posts WHERE post_type='product_variation'"

# Variations whose stock_status is misaligned with parent
wp db query "SELECT pv.post_parent, pv.ID, pm_qty.meta_value AS qty, pm_status.meta_value AS status
  FROM wp_posts pv
  JOIN wp_postmeta pm_qty ON pv.ID=pm_qty.post_id AND pm_qty.meta_key='_stock'
  JOIN wp_postmeta pm_status ON pv.ID=pm_status.post_id AND pm_status.meta_key='_stock_status'
  WHERE pv.post_type='product_variation'
    AND CAST(pm_qty.meta_value AS SIGNED) = 0 AND pm_status.meta_value='instock'
  LIMIT 50"

# Size of the wc_var_prices transient for one product
wp db query "SELECT LENGTH(option_value) AS bytes, option_name
  FROM wp_options
  WHERE option_name LIKE '_transient_wc_var_prices_%'
  ORDER BY bytes DESC LIMIT 10"

# Is the meta lookup table populated?
wp db query "SELECT COUNT(*) FROM wp_wc_product_meta_lookup"
# Should roughly match total product + variation count.

# Slow admin queries — enable Query Monitor or check MySQL slow log
tail -f /var/log/mysql/slow.log | grep wp_postmeta

# Time the product edit screen load
curl -o /dev/null -s -w "%{time_total}\n" -b cookies.txt 'https://example.com/wp-admin/post.php?post=12345&action=edit'

The most useful single signal is the first query — products with the most variations. If you have any product with 200+ variations, you have a performance issue waiting to happen.

The fix

  1. Re-evaluate the product structure. A t-shirt with 4 sizes, 12 colors, 3 fabrics, 2 fits as a single variable product is the wrong model. Consider:
    • Split into separate products by fabric or fit (lower variation count per product)
    • Use product attributes for filtering and a single variation product
    • Use a custom product type that handles configurators differently (the “PW WooCommerce Bulk Edit” or “WPC Product Variations Table” pattern)
  2. Increase the variations AJAX batch size. WooCommerce defaults to 10 per batch. Bump to 50 for less round-trip overhead, but keep in mind PHP-FPM memory:
    add_filter('woocommerce_admin_meta_boxes_variations_per_page', function () {
      return 50;
    });
  3. Disable the variation form on category pages. If you have a shop or category page that includes a quick-buy variation form, it loads the wc_data JSON for every product in the list. Move quick-buy to a JS-driven modal that fetches the variation data only when needed.
  4. Rebuild the product meta lookup table after migration. A migration or a database import can leave wp_wc_product_meta_lookup partially populated. Rebuild:
    wp wc tool run regenerate_product_lookup_tables
    # or via the admin: WooCommerce → Status → Tools → Regenerate the product lookup table
  5. Cap the transient size. If _transient_wc_var_prices_<product_id> exceeds 100KB, you have too many variations. Reduce variation count or partition the product.
  6. Move object cache to Redis. Without object caching, every variation lookup hits the database. With Redis (via Object Cache Pro or the free Redis Object Cache plugin), the variation prices and meta are served from memory. This single change halves the admin edit screen load time on high-variation products. See the existing Redis object cache article in this set.

For the WooCommerce performance baseline, the existing cpwp-woocommerce-performance-tuning article covers PHP and cache tuning. Pair with managed enterprise WordPress hosting for the structural review.


Stack Harbor audits WordPress WooCommerce catalogues for variation-related performance issues as part of managed enterprise WordPress hosting — the product structure, the variation table, and the cache layer. If your admin product edit takes more than five seconds, we can run the audit.