Contents
To add variation swatches in WooCommerce, create your attributes under Products → Attributes, install a free swatch plugin such as Variation Swatches for WooCommerce, and set each attribute’s Type to Color, Image or Button. Then give every term its colour or image. Variable products show the swatches instead of dropdowns automatically.
Everything below was tested on WordPress 7.1.5, WooCommerce 11.3.1, Variation Swatches for WooCommerce 2.6.2 and the Twenty Twenty-Five block theme (December 2026). By default WooCommerce shows variations as plain dropdowns, like this:

By the end you’ll have colour swatches, button swatches and image swatches on a variable product. You’ll also know how they behave when a shopper picks a combination, adds it to the cart, or picks one that is out of stock.
How to add variation swatches (6 steps)
Step 1: Create global attributes and terms
Swatches belong to attribute terms: “Red” gets a colour, “Stripes” gets an image. Terms only exist on global attributes, so create your attributes at Products → Attributes (not inside a single product), then use Configure terms to add the values. I created Color (Red, Blue, Green, Black), Size (36, 38, 40) and Pattern (Stripes, Dots, Plain). If you need a refresher, see our WooCommerce product attributes guide.
Step 2: Install a swatch plugin
In Plugins → Add New Plugin search for “Variation Swatches for WooCommerce” (slug woo-variation-swatches, about 300,000 active installs on WordPress.org) and activate it. I used version 2.6.2 and it ran without errors on WooCommerce 11.3.1. After activation the attribute Type field gains the options Color, Image, Button and Radio.
Step 3: Set the attribute type to Color (colour swatches)
Go to Products → Attributes, click Edit under “Color”, set Type to Color and click Update.

Now open Configure terms for Color. Each term (and the “Add new Color” form) has a Color picker. Pick a colour per term and save. The term list shows a coloured square next to each name.

Step 4: Button swatches for sizes, image swatches for patterns
Same screen, different type. Set Size to Button: no per-term setup is needed, the term name becomes the button label.

For Pattern choose Image as the type, then upload an image for each term in Configure terms (the form gets an Upload / Add image button). Small square images work best; mine are 120×120 px.

Step 5: Use the attributes on a variable product
Edit or create a product, set Product data to Variable product, open the Attributes tab, add the global attributes with Add global (select all terms, tick Used for variations) and click Save attributes.

Then open the Variations tab and generate one variation per combination (here 4 colours × 3 sizes = 12). Give each a price, and set any combination you can’t supply to out of stock. If you’re new to this, our variable products articles walk through it.

Step 6: Check the product page
Open the product. The Color attribute shows coloured squares and Size shows buttons. Add to cart stays greyed out until the shopper has chosen a value for every attribute.

Choosing Blue and 38 ticks both swatches, shows the selected value next to the label, updates the price to the variation’s price and enables Add to cart. A Clear link appears under the swatches so the shopper can start over.

Image swatches look like this on the Pattern attribute:

What happens at Add to cart (checked)
- Swatches are only a nicer front end. The product page still submits the normal WooCommerce form:
add-to-cart,variation_id,attribute_pa_colorandattribute_pa_size. I submitted Blue / 38 (variation ID 979) and WooCommerce confirmed “has been added to your cart”. - Cart block and classic cart. The cart contents come from WooCommerce, not the plugin. The Store API, which the Cart and Checkout blocks read, returned the line item with
Color: BlueandSize: 38. The plugin only changes the product page, so block and classic cart/checkout need no extra setup. - Out-of-stock combinations are still selectable by default. With Green selected, the 40 button was not crossed out. Picking Green + 40 (set to out of stock) shows “Out of stock” and keeps Add to cart greyed out. Posting that variation directly was rejected by WooCommerce with a message that it is out of stock.

For more on the add to cart flow itself see the ultimate guide to adding products to cart in WooCommerce. To show a different product photo for each colour, combine swatches with multiple images per variation. For a plain size attribute, see how to add sizes to products in WooCommerce.
FAQ
Can WooCommerce show colour swatches without a plugin?
Not out of the box: with no swatch plugin active, my test product showed plain dropdowns (first screenshot). You need a plugin or custom code to render colour, image or button swatches.
The attribute’s Type is still Select. With default settings the plugin turned my Select attributes into button swatches (I saw this on both a global attribute and a product-specific custom attribute). Set the type to Color or Image on Products → Attributes and add a colour or image to each term. Colour and image swatches are stored per term, so they only work with global attributes.
It is disabled until every attribute has a selection, and for a combination that is out of stock. Select a swatch in each group, or use Clear and start again.
Do variation swatches work with the Cart and Checkout blocks?
Yes in my test: the swatches live on the product page and the chosen attributes were returned by the same Store API the Cart and Checkout blocks use. The product page worked in the Twenty Twenty-Five block theme.
Are variation swatches free?
The plugin used here is free on WordPress.org and covered colour, image and button swatches in this guide, with no licence key.
Leave a Reply