← Back to Blog

WooCommerce Optimization Guide

3 min read

WooCommerce is a lot of WordPress. Cart and checkout cannot be page cached, which means the slow parts stay slow unless you go and fix them.

Start with the database

Expired transients and orphaned session rows accumulate quietly until a query that used to take five milliseconds takes five hundred.

  • Clear expired transients on a schedule
  • Prune wp_woocommerce_sessions
  • Move order storage to custom tables (HPOS)

High Performance Order Storage is the one on that list worth scheduling properly. Moving orders out of the posts table and into purpose-built tables with real indexes is the difference between an order search that returns instantly and one that times out, and the gap widens with every order you take.

Then the front end

Woo loads its cart fragments script on every page by default, including pages with no cart on them. Scope it.

add_action( 'wp_enqueue_scripts', function () {
    if ( is_cart() || is_checkout() ) {
        return;
    }

    wp_dequeue_script( 'wc-cart-fragments' );
}, 100 );

One warning: cart fragments are what keeps a “3 items” counter in the header accurate on a cached page. If your header shows a live cart count, removing this breaks it. Either keep the script on pages with the counter, or accept a count that updates on navigation instead of instantly.

Product images deserve the same scrutiny as everything else. A shop archive with twenty-four products is twenty-four images, and if each one is a full size upload scaled down in CSS, the page is many megabytes for no visible benefit.

Caching around the uncacheable

Cart, checkout, and account pages have to be excluded from page caching, and every decent caching plugin does that automatically. The mistake is assuming that is the end of it.

Those excluded pages are where purchases happen, which means they are the pages where speed is worth actual money, and they are the ones running full PHP and full database queries on every request. Object caching helps here where page caching cannot.

  • Put Redis or Memcached in front of the database
  • Keep the checkout page free of plugins it does not need
  • Move anything that can wait — email, analytics, CRM sync — into a background job

That last one matters more than it sounds. If placing an order synchronously calls three external APIs, your checkout is only as fast as the slowest of them on their worst day.

A checkout that takes an extra second costs more than any plugin you could buy to speed it up.

Measure the funnel, not the homepage

Store owners test the homepage because it is the obvious page to test. Almost nobody buys from the homepage. Time the product page, the add-to-cart response, and each checkout step, on a mid-tier phone, and fix whichever one is worst.

Leave a Reply

Your email address will not be published. Required fields are marked *

< wait />

Get a Free Website Audit

Before you go, let us analyze your website and send you a personalized report with actionable improvements.

No spam, just the findings. Usually in your inbox within minutes.