Platform guide

WooCommerce image optimization, explained

WooCommerce runs on WordPress, and WordPress has its own image-size system that is more hands-on than Shopify’s. That is both a strength — you get fine-grained control — and a source of confusion. This guide covers how WordPress generates image sizes, how WooCommerce adds its own, how to configure them for your theme, how to replace images without breaking things, and how to enable WebP.

How WordPress handles image sizes

When you upload an image to the WordPress media library, WordPress does not just store the original. It generates a set of resized copies at predefined dimensions, each saved as a separate file with a size suffix in the filename. For example, uploadingproduct.jpg might also createproduct-800x800.jpg,product-300x300.jpg, andproduct-150x150.jpg alongside the original.

These sizes are defined in two places:

  • WordPress core sizes: thumbnail (150px),medium (300px), and large (1024px). These are set in Settings → Media.
  • Theme and plugin sizes: themes and plugins register their own named sizes via theadd_image_size() function. WooCommerce, for example, registers woocommerce_single,woocommerce_thumbnail, andwoocommerce_gallery_thumbnail.

The important consequence: image sizes are generated at upload time. If you change a size setting after images are already uploaded, existing images keep their old sizes. You have to regenerate thumbnails to apply the new sizes to existing images.

WooCommerce’s image sizes

WooCommerce registers three named image sizes that control how product images appear across your store. You can find and change them in WordPress admin under WooCommerce → Settings → Products → General (scroll to the “Product images” section).

Size nameWhere it appearsDefaultCommon theme value
woocommerce_singleMain image on the single product page800 × 800px1000–1600px (zoom themes)
woocommerce_thumbnailProduct grid / shop / category pages300 × 300px600–800px
woocommerce_gallery_thumbnailSmall thumbnails in the product image gallery strip100 × 100px100–150px

The aspect ratio setting (1:1, 4:3, 3:4, etc.) controls how WooCommerce crops images to fit. A 1:1 ratio crops all product images to squares, which is common for fashion and apparel stores. A 4:3 or 3:4 ratio suits products that are taller than they are wide.

Why these defaults are often wrong: the 800px default for woocommerce_single was set years ago, when most themes did not support image zoom. Modern themes that offer click-to-zoom or hover-zoom need a larger source image — typically 1200–1600px — so the zoomed view stays sharp. If your theme supports zoom and your single-product image looks blurry when zoomed, raise woocommerce_single to 1600px and regenerate thumbnails.

How to configure image sizes for your theme

Every theme is different, so there is no universal “right” set of dimensions. But you can find the right values for your theme with a short investigation:

  1. Open a product page on your live store and right-click the main product image → Inspect. Look at the srcsetattribute on the <img> tag. It lists every size WordPress is generating for that image.
  2. Note the largest width in the srcset. That is the size your theme actually requests for the main display. Yourwoocommerce_single setting should match or slightly exceed it.
  3. Do the same on your shop/catalog page for the grid thumbnails. The largest width in the srcset is your target forwoocommerce_thumbnail.
  4. Set the aspect ratio to match your theme’s product image container. If your theme displays square product images, use 1:1.

After changing these settings, you must regenerate thumbnails for existing images (see below). New uploads will use the new sizes automatically.

Regenerating thumbnails

Because WordPress generates image sizes at upload time, changing the size settings does not affect images already in your media library. To apply new sizes to existing images, you need to regenerate thumbnails. This tells WordPress to re-process every image and create the new sized copies.

The standard way to do this is with the free “Regenerate Thumbnails” plugin by Alex Mills:

  1. Install and activate the “Regenerate Thumbnails” plugin from Plugins → Add New.
  2. Go to Tools → Regenerate Thumbnails.
  3. Click “Regenerate All Thumbnails.”
  4. Wait. On a large media library, this can take a while — it processes every image one at a time.

If you have a very large media library (thousands of images), run regeneration during a low-traffic period, as it is CPU-intensive and can slow your site while it runs. Some hosts limit how long a PHP process can run; if regeneration times out partway through, the plugin lets you resume from where it stopped.

Enabling WebP in WooCommerce

WordPress 5.8 (released July 2021) added native support for uploading WebP images to the media library. This means you can upload WebP files directly and WordPress will treat them like any other image, generating the standard resized variants from them.

However, WordPress does not automatically convert your existing JPEGs and PNGs to WebP — it only accepts WebP uploads. To get WebP on your store, you have two paths:

  • Convert before upload: use the compressor to convert your JPEGs and PNGs to WebP, then upload the WebP files to WordPress. This gives you full control over quality and dimensions. The downside is that WordPress generates JPEG variants from the WebP source by default, so some browsers may still receive JPEG.
  • Use a conversion plugin: plugins like WebP Express, Converter for Media, or ShortPixel automatically generate WebP copies of your existing images and serve them to supported browsers via a rewrite rule. This is more convenient for large existing catalogs but adds a plugin dependency.

For most stores, the plugin approach is more practical if you have an existing catalog — it avoids re-uploading everything. If you are starting fresh or adding new products, uploading pre-converted WebP files keeps your media library clean and avoids an extra plugin.

Replacing existing product images

Unlike Shopify, WordPress lets you replace the file behind an existing media entry without changing its ID — which means all references to that image (in products, posts, menus) stay intact. This is done with the free “Enable Media Replace” plugin:

  1. Install and activate “Enable Media Replace.”
  2. Go to Media → Library and click the image you want to replace.
  3. Scroll down to the “Replace media” section and click “Upload a new file.”
  4. Choose “Just replace the file” to keep the same URL, or “Replace the media file and update the URL” if you want a new filename.
  5. Upload your optimized WebP or JPEG file.
  6. After replacing, regenerate thumbnails so WordPress creates the sized variants from the new file.

For bulk replacement across many products, the most reliable approach is a combination of Enable Media Replace (to swap files) and Regenerate Thumbnails (to rebuild sizes). There are also premium plugins that batch-replace, but the free combination works for most stores.

Common WooCommerce image problems and fixes

Blurry product images on the single product page

This is almost always a woocommerce_single size that is too small for your theme. Check the srcset on your product page: if the largest size is 800px but your theme displays the image at 1000px+, raise woocommerce_single to 1200–1600px and regenerate thumbnails.

Product images are cropped to the wrong shape

The aspect ratio setting in WooCommerce → Settings → Products controls cropping. If your product photos are being cut off (heads, feet, or edges missing), change the aspect ratio to match your source images, or set it to “Uncropped” to preserve the original aspect ratio. Note that uncropped images may look uneven in a grid if your source images have mixed aspect ratios.

Shop grid images look low quality

The default woocommerce_thumbnail is 300px, which looks soft on modern high-DPI displays. Raise it to 600–800px and regenerate. The file size increase is modest because thumbnails are displayed small, but the sharpness improvement on retina screens is noticeable.

Images not showing after migration or domain change

WordPress stores image paths as URLs in the database. If you migrate to a new domain or change your directory structure, image URLs may still point to the old location. Use a search-and-replace tool like Better Search Replace (with serialization-safe replacement) to update all image URLs in the database at once.

Media library is huge and slow

Every uploaded image generates multiple sized copies, so a 5 MB original can become 8–10 files totaling 7 MB+ across all sizes. Over thousands of products, this adds up. Pre-optimizing your source images before upload keeps the total media library size manageable. You can also disable unused image sizes by removing them from your theme’s functions.php or via a plugin like “Disable Generate Image Sizes.”

Lazy loading in WordPress

Since WordPress 5.5, images are lazy-loaded by default via the nativeloading="lazy" attribute. WooCommerce inherits this behavior. This means below-the-fold images (gallery thumbnails, related products) load only when the shopper scrolls near them, which reduces initial page weight.

The one exception is the LCP image — usually your hero banner or the main product image. WordPress 5.9+ automatically skips lazy-loading for the first large image on the page, but if you have a custom hero section, verify it loads eagerly. Addingfetchpriority="high" to your hero image gives the browser an explicit hint to prioritize it.

A practical WooCommerce image workflow

  1. Check your theme’s actual image sizes by inspecting the srcset on a product page and shop page.
  2. Set woocommerce_single and woocommerce_thumbnail to match (or slightly exceed) those sizes in WooCommerce → Settings → Products.
  3. Export product photos from your camera or editing tool at full resolution.
  4. Open the compressor, select WooCommerce, and choose the matching preset.
  5. Set quality to 80% and process a test batch of 3–5 images.
  6. Verify quality at 100% zoom, then batch the rest of your catalog.
  7. For existing products, use Enable Media Replace to swap files, then Regenerate Thumbnails.
  8. For new products, upload the optimized files directly.
  9. Run PageSpeed Insights on a product page before and after to confirm the improvement.

For the settings to use per image role, see our compression settings guide. For batch-processing a whole catalog, see our batch workflow guide.

Editorial note

This guide reflects how WordPress and WooCommerce handle images at the time of writing. WordPress and WooCommerce are updated frequently, and specific behaviors (default sizes, WebP handling, lazy-loading logic) may change between versions. Always back up your site before making bulk changes to your media library. See our about page and editorial standards for more on how we write these guides.

Free WebP compressor

Ready to optimize your WooCommerce images?

Drop your product photos into the compressor, pick the WooCommerce preset, and download lighter WebP files ready for upload.

Open the compressor