Adding Product Variations in WooCommerce – Step by Step

Product variations in WooCommerce let you sell one product in several combinations, such as different sizes, colors, or any attribute you define. Each variation can have its own price, stock, and image. This guide walks through the whole process: creating attributes, building a variable product, and setting the options for each variation.

I retook every screenshot on a clean WooCommerce 11.3 store, so the screens match what you see today.

If you’re new to WooCommerce, start with our guide on how to create an online store with WooCommerce.

Creating New Product Attributes

Before creating a product with variations, you’ll need to create its attributes first. In the WordPress dashboard, go to Products > Attributes, create two new attributes, and name them. For this example, I’ll use the attributes “Color” and “Size”.

WooCommerce Products Attributes screen with Color and Size attributes and their terms

The Products > Attributes screen

You can also create an attribute that belongs to one product only, straight from the product edit page. More on that in the FAQ below.

Once you’ve created the attributes, click Configure terms next to each one to add its terms. For example, under Color, create terms such as “Red,” “Green,” and “Blue.” Under Size, you might add “Large,” “Medium,” and “Small.” Here’s the terms screen for Color:

Configure terms screen for the Color attribute with Blue, Gray, Green, Red and Yellow

Adding terms to the Color attribute

The key thing to remember is that a combination of terms from your attributes, such as “Green” and “Medium,” creates a variation.

Creating a Product with Variations

Next, create the product. In the WordPress dashboard, go to Products and click Add New. In the Product data box, select Variable product from the dropdown. You’ll still need to add the usual product details, of course, but this guide focuses on adding product variations.

Product data box with Variable product selected as the product type

Choosing Variable product in the Product data box

Assigning Attributes to the Product

Open the Attributes tab and choose an attribute from the Add global dropdown. Repeat this for each attribute, then select the values (terms) available for this product:

Attributes tab of a variable product with Color and Size values and Used for variations checked

Color and Size added to the product, with their values

Important Points to Remember

  1. Make sure Used for variations is checked, otherwise the attribute won’t appear in the Variations tab. Visible on the product page controls whether it appears in the product’s Additional information tab.
  2. Select only the terms that apply to the product. For example, if a product is available only in Medium, add just that term. Click Save attributes when you’re done.
  3. Click Select all to add every term for that attribute, or Select none to clear them all.
  4. Click Create value to add a new term without leaving the product page.

Setting Specific Variations for the Product

Now define the specific variations for the product. A variation is a single combination of terms, such as Green + Medium. Open the Variations tab on the product page:

Variations tab with Default Form Values, Generate variations, Add manually, Bulk actions and nine variations

Nine variations generated from 3 colors and 3 sizes

Additional Tips

  • Generate variations creates every possible combination in one click. Three colors and three sizes give you nine variations, as shown in the screenshot. Use Add manually when you want to add just one combination instead.
  • Under Default Form Values, choose the combination that is pre-selected when a customer opens the product page.
  • The Bulk actions dropdown lets you set prices, stock, and other fields for all variations at once. It can save a lot of time on larger products.
  • For products with up to 30 variations, WooCommerce embeds all variation data in the page, so the dropdowns hide combinations that don’t exist. Above 30, it loads each variation by AJAX after the customer makes a choice, and the dropdowns list every option. Keep that in mind when planning products with lots of combinations.

Setting Variation Options for a Specific Product

You can edit details for each variation, including price, stock status, and SKU, by clicking Edit next to the variation in the Variations tab.

Here are the settings for the Green + Medium variation from the example:

Expanded variation settings: gallery, SKU, GTIN, prices, stock, shipping, customs and description

The settings of a single variation

Most settings here are self-explanatory, and some fields may auto-fill based on earlier choices. You can set a regular and sale price, stock, weight and dimensions, and mark the variation as downloadable or virtual.

Three newer fields are worth knowing about:

  • GTIN, UPC, EAN, or ISBN (since WooCommerce 9.2) – the product identifier that Google Shopping and other channels ask for.
  • Variation gallery (since WooCommerce 11.1) – each variation can have several images, rather than just one. The first image is the primary.
  • Customs (since WooCommerce 11.3) – commodity code, country of origin and a customs description, for stores that ship abroad.

Save your changes, publish the product, and that’s it. Here’s how the variation from the example looks on the product page, with its own price, sale and stock:

Variable product page with Green and Medium selected, showing the sale price and stock

The Green + Medium variation on the product page

If you need to add extra data beyond the built-in fields, see our guide on adding custom fields to WooCommerce products.

Displaying Variations as Swatches

By default, WooCommerce uses a dropdown for variation selectors. If you’d rather show color swatches, image buttons, or size boxes, the Variation Swatches for WooCommerce plugin is a popular option, with more than 300,000 active installs on WordPress.org.

For more variation-related tools, the WooCommerce extensions store offers options for bulk pricing, conditional variations, and more.

FAQs

Common questions about WooCommerce product variations:

How many variations can a single WooCommerce product have?
There is no hard limit. Each variation is stored as its own post in the database, so very large products make the edit screen and the product page heavier. Above 30 variations, WooCommerce also stops embedding variation data in the page and loads each one by AJAX instead.
Can each variation have a different price?
Yes. Every variation has its own regular price and optional sale price. You can set these individually per variation, or use the bulk edit dropdown in the Variations tab to apply a price to all variations at once.
Can I track stock separately for each variation?
Yes. In each variation's settings, enable Manage stock? and enter a stock quantity. WooCommerce will track inventory per variation independently, and each out-of-stock variation can show as unavailable without affecting the rest.
How do I set a default variation on the product page?
In the Variations tab, use the Default Form Values field to select the attribute terms that should be pre-selected when a customer lands on the product page. This won't prevent customers from choosing other options - it just sets the initial state.
Why are my variation dropdowns not filtering dynamically?
Your product probably has more than 30 variations. Up to 30, WooCommerce embeds all variation data in the page and hides combinations that don't exist. Above that, the dropdowns show every option and WooCommerce checks the chosen combination by AJAX. You can raise the limit with the woocommerce_ajax_variation_threshold filter.
Can I add a custom attribute that doesn't exist globally?
Yes. On the product edit page, under the Attributes tab, click Add new instead of choosing from Add global. Custom attributes are local to that product and won't appear in the global attributes list under Products > Attributes.

Summary

Variable products are one of WooCommerce’s most flexible features. Once you understand how attributes, terms, and variations fit together, the process is pretty straightforward. The FAQ above covers the most common issues with stock tracking, pricing, and frontend display. Feel free to leave a comment if you have questions.

Summarize with AI Claude ChatGPT Google AI
Discussion
[  0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!