WooCommerce: Change the Image When a Variation Is Selected

WooCommerce: Change the Image When a Variation Is Selected - featured woocommerce variation image color

A shopper opens your product page and taps the navy swatch. The swatch gets a ring around it. The big photo still shows the red one.

Now they’re not sure what they’re buying. Is navy darker than they think? Does it have the same stitching? Some will close the tab rather than guess.

Most store owners blame the swatches plugin first. Usually the cause is somewhere else: a missing variation image, a variation set to “Any Color”, or a theme that replaces WooCommerce’s normal gallery.

WooCommerce core now does more of this work for you. Since WooCommerce 11.1, every variation can have its own gallery of images, and the feature is on for every store.

This guide walks through the setup in order: images first, then swatches, then the four usual reasons the photo doesn’t change. It ends with a quick check on your phone.

Shoppers judge the color from the photo, so the photo has to change

A swatch is a small dot. It tells shoppers a color exists. The photo is where they check the shade, the fabric and how it looks on a person.

Baymard’s research on color searches found that shoppers who look for a color expect the product images to show that color. When the images don’t match, people struggle to judge the product and often have to dig further to check.

The same thing happens on your product page. If the photo stays the same after a click, the swatch looks broken, even when the right variation is in the cart.

So the swatch and the photo need to work as a pair. Open your best-selling variable product now. Does every color change the main photo?

Start with the images. Swatches can’t show a photo you never added. Here’s the setup, per WooCommerce’s docs:

WooCommerce: Change the Image When a Variation Is Selected - select main image for a variation
  1. Go to Products, edit your variable product, and open the Variations tab.
  2. Expand a variation and click the image placeholder. Pick the main photo for that color.
  3. Want more angles? Click Manage next to Variation gallery, pick the images, and drag them into order. The first image becomes the main one.
  4. Click Save changes.

When a shopper picks that variation, the gallery switches to its images. When they clear the choice, the product’s main gallery comes back. This works with both the classic gallery and the block-based Product Gallery.

Used the Additional Variation Images extension before? WooCommerce 11.1 turns it off for you and moves your galleries into core in the background. Your existing galleries keep showing. If you have a large catalog, test the update on a staging site first. That’s a private copy of your store where mistakes don’t cost sales.

One more setting helps here. Set Default form values at the top of the Variations tab. The page then opens with a real color picked, so shoppers see its photos right away.

Step 2: Use color or image swatches so the click matches the photo

A dropdown works, but it hides the link between choice and photo. Swatches make the link visible: tap a color, see that color.

For solid colors, a color dot is fine. For patterns, like plaid or floral, use an image swatch cut from the real product photo. A flat color can’t show a pattern.

You have two ways to add swatches:

  • WooCommerce core: a Color / Image attribute type arrived in WooCommerce 10.9. It’s experimental and works only in block themes, with the Add to Cart + Options (Beta) block.
  • A swatches plugin: works with classic themes too, and usually adds label and button swatches for sizes.

If you go with core swatches, check one more block. A WooCommerce developer explained in the comments on that announcement that the photo only follows the swatch with the newer Product Gallery block. The older Product Image Gallery block doesn’t sync.

When the photo doesn’t change, check these four things

Go through these in order. The first two take a minute each to check.

1. The variation has no image. Open each variation and look for the placeholder. If a color has no photo, there’s nothing to switch to.

2. A variation is set to “Any Color”. “Any” lets one variation match every value of an attribute. That one variation can hold only one set of images, so every color shows the same photo.

There’s a second catch. When variations overlap, WooCommerce uses the first match from top to bottom. A general “Any Color” variation sitting above “Blue” can win. WooCommerce recommends setting every attribute on every variation. If you can’t, put specific variations at the top.

3. Your theme replaced the gallery. Some themes and page builders use their own product gallery. WooCommerce’s docs say that if images don’t switch, check that your theme uses a standard WooCommerce product gallery. On staging, switch to a default theme for a minute. If the photo changes there, your theme is the cause, so contact its developer.

4. The product has more than 30 variations. Above 30 variations, WooCommerce shows static dropdowns with every option, even combinations you don’t sell. A shopper can pick one that doesn’t exist and see “Sorry, no products matched your selection.” No match means no new photo.

A developer can raise that limit with a small code filter. If you add one, use a plugin like Code Snippets or WPCode instead of editing theme files.

On mobile, make sure shoppers can see the photo change

Open your product page on a phone. Tap a color. Did the photo change where you could see it, or did it happen above the screen while you were looking at the swatches?

If shoppers have to scroll up to check, some won’t. Look at your product template and keep the swatches close to the gallery on small screens.

Then swipe through the photos for one color. WooCommerce 11.3, due the week of November 9, 2026, makes swiping in the Product Gallery block smoother on phones. Images now follow your finger. After you update, test a full swipe on a variation with several photos.

How WCBoost Variation Swatches can help

  • Any theme: works with classic and block themes, with no feature flag and no template rebuild.
  • Every swatch type: color, image, label and button swatches, with tooltips that show the option name.
  • No dead ends: hide or blur combinations you don’t sell, so shoppers don’t land on a choice with no photo.
  • Swatches from your photos (Pro): create image swatches from your variation images automatically.

Setup steps are in our docs.