Skip to content

WooCommerce Variable Products: How to Create a Product with Sizes and Colors

A practical guide to creating variable products in WooCommerce: the difference between attributes and variations, global vs. custom attributes, the setup steps and configuring each variation (price, stock and image), performance limits when variations pile up, and common problems and their fixes.

E-commerceنورة العنزي27 min read
Illustration of a T-shirt branching into colour swatches and size tiles, representing a product with variations
On this page

If you are completely new to the platform, first read What is WooCommerce? to understand the big picture, and if you are building your store from scratch, the launching an online store guide covers the full sequence. Here we focus on one specific piece that confuses many people: the variable product.

What is a variable product and when do you actually need one?

A variable product is a WooCommerce product type that lets you display several versions of one item on a single product page. Instead of creating a separate product for every size and color of the same T-shirt, you create one product called "Cotton T-shirt" and add the size and color options inside it. The customer picks from two dropdowns on the product page, and the price, image and stock update automatically based on their choice.

The core idea to fix in your mind from the start: every purchasable combination, such as "Red, size S", is an independent entity with its own price, its own stock, possibly its own image, and its own SKU. This independence is what sets a variable product apart from simply displaying a list of descriptive options. You are not just showing "available colors"; you are managing stock and prices at the level of each combination.

So the decisive question before you touch the dashboard is: does the option you want to add affect the price, stock or SKU? If the answer is yes, you are dealing with a variable product. Size affects stock (you have twenty pieces in size M and only five in XXL), color may affect stock and the image, and sometimes size affects the price (larger sizes cost a bit more). All of these cases call for a variable product.

But if the option is purely descriptive and has no effect on the purchase, such as noting that the fabric is "Egyptian cotton" or that the country of origin is "Turkey", there is no need to complicate your life with variations. A display attribute that appears in the specifications table on the product page, without generating any variation, is enough. Telling the two cases apart saves you dozens of pointless variations that weigh down your store for no benefit.

Take a concrete example from a clothing store. You sell a dress in several colors (black, navy, beige) and sizes (S, M, L, XL). Each combination has separate stock, because "Navy M" sells out at a different rate than "Beige XL". This is a textbook variable product. But when you mention that the dress is "machine washable", that is descriptive information that doesn't generate a variation; you write it in the product description or as a display attribute only.

Attribute vs. variation: the difference that decides everything

What confuses beginners most is mixing up two terms: attribute and variation. Understanding the difference is not linguistic hair-splitting. It is the key that makes everything after it make sense, and misunderstanding it is the source of most of the problems we will tackle later.

How does a WooCommerce variable product work?Variable product(Shirt)Attribute: colorRed · Blue · BlackAttribute: sizeS · M · LVariations: every combinationRed-S · Red-M · Blue-L … each with price, stock, imageAttributes describe the options; variations are the products you can actually buy
A WooCommerce variable product: attributes (color, size) define the options, then generate the variations; each combination is a purchasable product with its own price, stock and image.

An attribute describes the options available at the product level. When you say "Color: Red, Blue, Green", you are defining an attribute called "Color" with three values. An attribute is abstract; it has no price and no stock. It is simply the list of possibilities. A variation, on the other hand, is a specific purchasable combination of attribute values, such as "Red, size S", and it has its own price, SKU, stock, weight and image. In other words: the attribute is the dimension, and the variation is the point inside the grid.

The relationship between them is simple math: variations are the product of the values of the attributes marked as used for variations. If you have a color attribute with three values and a size attribute with four values, and you mark both for use in variations, you get 3×4 = 12 possible variations. This multiplication is what makes the number of variations explode quickly if you aren't careful, and we will come back to it in the performance section.

AspectAttributeVariation
What is it?Describes the available optionsA specific purchasable combination
Example"Color: Red / Blue""Red, size S"
Does it have a price?NoYes (Regular price is required)
Does it have stock?NoYes (optionally at its own level)
Does it have a SKU?NoYes (inherits the parent's if left empty)
Does it have an image?NoYes (swaps the image gallery on selection)
How is it created?You define it in the Attributes tabGenerated by multiplying the marked attribute values
Required for purchase?Not on its ownYes, the customer buys a variation, not an attribute

The practical key here is a small checkbox in the interface called "Used for variations". When you check it on an attribute, you tell WooCommerce: "This attribute must be part of the variation combinations." If you forget it, the attribute remains just a description shown on the page without generating any purchasable option. That is where the "my variations don't show up" complaint that tops the support forums comes from.

Pay close attention to another subtle distinction: the "Used for variations" box is not the "Visible on the product page" box. The first brings the attribute into the variation logic, while the second only controls whether it appears in the specifications table. An attribute can be visible without being used for variations (purely descriptive), or used for variations without being "visible" in the specifications table (because it will appear as a selection dropdown anyway). Confusing the two boxes is a common mistake, so look at them carefully.

Global vs. custom attributes: which should you choose?

Before you create your product, you face an early decision that saves you hours later: will you use global or custom attributes? The difference is not cosmetic; it affects filtering and reuse across your entire store.

A global attribute is created once from the Products > Attributes menu in the dashboard and then becomes available to all your products. Its values are not free text but registered "terms", just like categories and tags. When you create a global attribute called "Color" and add the terms (Red, Blue, Black), you can reuse it in every new product with a single click, and the values stay consistent across the store, with no "Red" here and "red" there.

More importantly, filtering works only with global attributes. If you want visitors to be able to filter products by color in the sidebar (via the Layered Nav / Filter Products by Attribute widget), global attributes are the only way. Custom attributes don't support filtering at all. For a clothing store with hundreds of items, the ability to filter by color and size is not a luxury but a marketing necessity, which is why we recommend global attributes for most serious fashion stores.

A custom attribute, by contrast, belongs to a single product only, and its values are entered as free text separated by the pipe character |, for example: Red | Blue | Black. It is quicker to create on the spot and useful for a unique option that won't recur in another product (such as "an exclusive print for this piece only"). But it can't be filtered or reused, and if you write the color in different ways across different products, your data becomes scattered.

AspectGlobal attributeCustom attribute
Where is it created?Products > Attributes (once)Inside the product itself
ScopeThe whole store (reusable)This product only
Value typeRegistered termsFree text separated by |
Supports filtering (Layered Nav)?YesNo
Consistent values across productsYesNo (prone to inconsistency)
Initial setup speedA bit slower (define it first)Faster (direct)
Best forA recurring color/size in a fashion storeA unique, non-recurring option

The rule of thumb: if the attribute will recur across products or needs filtering, make it global. Color, size and material in a clothing store are all strong candidates for global attributes. Keep custom attributes for rare, unique cases. The upfront investment in building well-organized global attributes pays off with every new product you add.

Step-by-step: creating a variable product

Now for the hands-on part. Together we will build a "Cotton T-shirt" in two colors (White, Black) and three sizes (S, M, L), which makes six variations. Follow the steps in order: each step builds on the previous one, and the order is not arbitrary.

Step 1: Create the product. In the dashboard, go to Products > Add New Product. Enter the product name "Cotton T-shirt" and add its general description and main image, as with any regular product.

Step 2: Choose the variable product type. Scroll down to the "Product data" box, where you will find a dropdown that shows "Simple product" by default. Open it and select "Variable product". This point is pivotal: if you leave it on "Simple product", the Variations tab won't appear at all, and that is where the "No options available" complaint comes from later.

Step 3: Define the attributes. Go to the "Attributes" tab inside the Product data box. There are two paths here:

  • For a global attribute: open the "add existing" dropdown and choose the attribute you defined earlier under Products > Attributes (such as "Color"), then click "Select values" to pick the values this specific product includes (for example, only White and Black, even if the global attribute contains ten colors).
  • For a custom attribute: click "Add new", enter the attribute name (such as "Size") and its values in the values field, separated by the pipe character: S | M | L.

Step 4, the most important: check "Used for variations". Next to every attribute you want included in the variations, check the "Used for variations" box. In our example we check it for both color and size. This is the step people forget, and half the world's problems start there. And a repeat reminder: "Used for variations" is not "Visible on the product page"; don't confuse the two.

Step 5: Save the attributes. Click "Save attributes" below the attribute list. Don't skip this button: without saving the attributes, the Variations tab won't know they exist.

Step 6: Generate the variations. Go to the "Variations" tab. You have two options:

  • "Generate variations": WooCommerce automatically creates every possible combination; in our example, 2 colors × 3 sizes = 6 variations in one go. This is the best option when you want all combinations.
  • "Add manually": you add variations one at a time and choose their values yourself. Useful when you don't want every combination (for example, size L is only available in black).

Step 7: Configure each variation. Expand each variation (click it to open it) and set its data: the price above all, plus stock, image and SKU as needed. We cover these settings in detail in the next section because they deserve a closer look.

Step 8: Save and publish. Click "Save changes" inside the Variations tab, then "Publish" to publish the product. Check the product page on the storefront to make sure both dropdowns appear and work.

Two more options are worth knowing. Default form values lets you choose a variation that is preselected when a visitor opens the page (for example, "White, M") instead of empty dropdowns, which improves the buying experience. And Bulk actions at the top of the Variations tab lets you apply a value to all variations at once, such as setting a single price or enabling stock management for all of them. It is a huge time-saver when you have many variations.

Configuring each variation's settings

When you open a single variation, you will find a set of fields that control its behavior. Understanding each field spares you mistakes later, and the most critical of all is the price field. Here are the fields, ordered by practical importance.

SettingWhat does it do?Critical note
ImageAn image specific to the variationSwaps the image gallery when the customer selects it
SKUA unique code for the variationAutomatically inherits the parent's SKU if left empty
EnabledTurns the variation's display on/offDisable it to hide a combination without deleting it
Regular priceThe base priceRequired: a variation without a price is never displayed
Sale priceThe discounted priceOptional, for offers on that specific variation
Manage stock?Enables stock at the variation levelOpens the quantity field for this variation alone
Weight / DimensionsWeight and dimensionsInherit the parent's values if left empty
Shipping / Tax classShipping class and taxTo customize shipping or tax for a specific variation
DescriptionA short description of the variationAppears when the variation is selected on the page

The non-negotiable field is Regular price. Make absolutely sure you fill it in for every variation. The strict rule in WooCommerce: any variation without a regular price never appears to the customer. If you generate six variations, price five and forget the sixth, the sixth disappears from the dropdowns as if it didn't exist, and a puzzled customer will ask you "Why can't I find size L?". If all your variations have the same price, use Bulk actions to set the price on all of them at once; it is faster and safer than manual entry, which is prone to oversights.

The image is an important user-experience touch in a clothing store: when you assign a photo of the black T-shirt to the "Black" variation, the displayed image switches to black as soon as the customer selects that color. This makes the product page lively and convincing. Note that assigning multiple images (a gallery) to each variation, rather than a single image, only became available in recent WooCommerce versions (the "Variation Gallery" feature, from roughly WooCommerce 10.9), so don't assume it exists on older installations, and check your version.

The remaining fields work on an "inheritance" logic: if you leave SKU, weight or dimensions empty, the variation inherits the parent product's value. This is convenient: define the weight once at the parent level and leave it empty in identical variations, customizing only when a variation genuinely differs (say, a winter coat that gets heavier with size). Don't burden yourself by filling in every field in every variation; fill in only what differs and let inheritance handle the rest.

Stock management: at the parent or the variation level?

Stock is one of the main reasons to choose a variable product in the first place, because it gives you flexibility to track quantities at two different levels. Understanding the difference between them prevents the surprise of selling items that are already out of stock.

Level 1: Stock at the parent level. If you don't check "Manage stock?" inside the variations, stock is managed at the parent product level as a shared balance. You enter a single quantity (for example, 50 pieces), and every sale of any variation is deducted from that combined balance. This works when you don't need precise tracking of each combination, or when the stock genuinely is shared. But it doesn't distinguish between them: if the black color runs out while white remains, the system won't know, and it will keep selling the sold-out black.

Level 2: Stock at the variation level. When you check "Manage stock?" inside each variation, a quantity field opens just for it. You enter 20 pieces for "Black M" and 5 pieces for "Black L", and WooCommerce tracks each one separately, stopping sales of that specific variation when it runs out without touching the others. This is the right choice for a serious clothing store, because sizes and colors sell out at different rates, and you want the customer to know that "Black L" is sold out while "Black M" is available.

There is also a mixed setup: you can enable stock management on some variations and not others. Variations with management enabled draw from their own stock, and the ones you left alone draw from the parent's shared stock. This is useful when some combinations are limited in number and need precise tracking, while others are plentiful and the general balance is enough for them. The rule of thumb: enable variation-level stock management for items that sell out at different rates, and leave the rest on the parent.

Performance limits: how many variations before your store slows down?

This is a point where information is often passed on incorrectly, so let's be precise. WooCommerce has a known official threshold of 30 variations, and it is a display threshold, not an absolute maximum:

  • If the product has 30 variations or fewer, the dropdowns are displayed dynamically with AJAX filtering: when the customer picks a color, the list of sizes available with it is filtered instantly without a page reload.
  • If it exceeds 30 variations, the dropdowns switch to static mode (full lists without the smart filtering between them) to protect performance.

What matters is understanding that this threshold is a display limit, not an absolute maximum: your product can contain more than 30 variations, but it loses the nice dynamic filtering experience and shows static dropdowns instead.

You can raise the threshold in code via the woocommerce_ajax_variation_threshold filter, but be careful: raising it increases the load rather than reducing it. When you raise the threshold, you force WooCommerce to load all the variation data into the page at once so it can filter it via AJAX, and that weighs down the product page for products with huge numbers of variations. So the filter is not an "optimization" but a trade-off: a better filtering experience in exchange for a heavier load. Use it with care and with real measurements.

As for the numbers that circulate on blogs, such as "100 or 200 variations start slowing the store down", they are third-party estimates, not an official commitment from WooCommerce. Actual performance depends on your server, theme and plugins, and there is no single magic number. Treat them as general warning signs, not hard limits.

The real danger with variations is not any particular number but combinatorial explosion. Remember that variations are a product: three attributes with five values each means 5×5×5 = 125 variations for a single product! That is both an administrative and a performance nightmare. The cure is not some miracle tool but deliberate design: reduce the number of attributes marked "Used for variations". Ask yourself: does every attribute really need to be a variation? Perhaps "Material" works fine as a descriptive display attribute, while only color and size deserve variations. Every attribute you take out of the variation multiplication divides the final count.

Marked attributesExampleNumber of variationsAssessment
One attributeSize (S,M,L,XL)4Excellent
Two attributesColor(3) × Size(4)12Very good
Two wider attributesColor(5) × Size(6)30Dynamic display limit
Three attributesColor(5) × Size(5) × Material(5)125Overwhelming: review your design

Before we leave performance, remember that the speed of a variable product page is part of your store's overall health. If your store is slow in general, variations won't be the only cause; see WooCommerce store performance to address the bigger picture of caching, the database and images.

Common problems and their fixes

Most variable product troubles recur in familiar patterns, and their fixes are straightforward once you know the root cause. Here are the most common ones in a diagnostic table, followed by an explanation of the most important.

ProblemRoot causeFix
Variations don't appear in the dropdownThe attribute isn't marked "Used for variations"Check the box, then save and generate the variations again
"Add to cart" button is grayed outOne or more variations have no Regular priceAdd a regular price to every variation
«No options available»The product type isn't Variable, or no variations have been generatedChange the type to Variable and generate the variations
Dropdowns grayed out with a huge countThe AJAX threshold (30 variations) is exceededReduce the variations or adapt to static mode
Conflict after a theme/plugin updateA conflict in templates or codeTry the Storefront theme and disable plugins one by one
Variation images don't appearThumbnails haven't been generated yetRegenerate thumbnails from Status > Tools

The variations don't appear at all. This is the most common problem, and nine times out of ten the cause is that the attribute wasn't marked "Used for variations". Go back to the Attributes tab, check the box for every relevant attribute, click "Save attributes", then go to Variations and generate them again. The problem is usually solved immediately.

The purchase button is grayed out and can't be clicked. Once the customer selects a complete variation, the button should become active. If it stays gray, the most common cause is a variation without a regular price. Go through all your variations and make sure each one has a Regular price. A single forgotten variation is enough to break the experience for that combination.

The "No options available" message. It appears when the product type is still "Simple product", or when no variations have been generated even though the correct type was selected. Check two things: that the type is "Variable product", and that you actually generated the variations in the Variations tab.

Dropdowns grayed out with a huge number of variations. If your product contains a very large number of variations and the dropdowns behave strangely, you may have exceeded the AJAX threshold. The healthy fix is to reduce the variations (see combinatorial explosion), not simply to raise the threshold, which increases the load as we explained.

A theme or plugin conflict. If strange behavior appears after an update, isolate the cause the classic way: temporarily switch to the official Storefront theme, then disable plugins one at a time until the behavior returns to normal. When it does, you have found the culprit. This is a general troubleshooting method that works for most WordPress problems, and we covered it in detail in the complete WordPress guide.

Variation images don't appear. If you assigned the images but they aren't displayed at the right size or don't appear at all, the thumbnails may not have been generated. Go to WooCommerce > Status > Tools and use the Regenerate thumbnails tool to regenerate them. That usually solves the problem.

One last expert tip: test your variable product through a customer's eyes before final publication. Open the page on the storefront, try every combination, and make sure the price updates, the image switches and the button becomes active. Ten minutes of testing saves you messages from confused customers later.

Frequently asked questions

What is the difference between a simple product and a variable product in WooCommerce?

A simple product is a single item with one price and one stock level and no options. A variable product is a single item with several variations, each with its own price, stock and image. Use a variable product when the options (color/size) affect the price, stock or SKU.

Why don't my variations show up on the product page?

The most common reason is that you didn't check the "Used for variations" box on the attribute. Go back to the Attributes tab, check it for every relevant attribute, click "Save attributes", then generate the variations from the Variations tab. Another possible reason is that you haven't generated any variations yet at all.

Why is the "Add to cart" button grayed out and not working?

Because one or more variations have no regular price. The rule in WooCommerce is that any variation without a Regular price is neither displayed nor purchasable. Go through all your variations and add a price to each one; a single forgotten variation is enough to disable the button for that combination.

What is the maximum number of variations for one product?

There is no absolute maximum. The official 30-variation threshold is only a display limit: 30 or fewer gives dynamic dropdowns with AJAX filtering, and more than 30 turns them into static dropdowns. The larger numbers (100/200) often cited as the point where things slow down are third-party estimates, not an official commitment, and they depend on your server and theme.

What is the difference between a global and a custom attribute, and which is better?

A global attribute is created once under Products > Attributes and reused across your products; its values are registered terms, and filtering works only with it. A custom attribute belongs to a single product, its values are entered as text separated by |, and it cannot be filtered. For a clothing store that needs filtering by color and size, global attributes are clearly better.

Can I set a different price for each size or color?

Yes, and that is one of the main reasons to use a variable product. Each variation has its own Regular price (and an optional Sale price). So you can make size XXL more expensive than S, for example, simply by entering a different price in each variation.

How do I manage stock for each variation separately?

Check the "Manage stock?" box inside the variation itself, which opens a quantity field just for it. If you leave it unchecked, stock is managed at the parent level as a shared balance. You can mix the two: some variations with their own stock and others on the parent.

Does each variation support more than one image?

A single image per variation has been supported for a long time (it swaps the gallery when the variation is selected). A multi-image gallery per variation ("Variation Gallery"), however, is a newer feature that appeared around WooCommerce 10.9, so don't assume it is available in older versions; check your version.

When should I use a display attribute without variations instead of a variable product?

When the option is purely descriptive and doesn't affect the price, stock or SKU, such as the fabric type or the country of origin. In that case an attribute that appears in the specifications table without generating variations is enough, and you avoid weighing your product down with pointless variations.

How do I connect a payment gateway to my variable products?

Variable products are bought and paid for like any other product; they need no special payment setup. Configure your payment gateway once at the store level, as in the WooCommerce payment gateways guide, and it will automatically work with all variations.

Conclusion

The WooCommerce variable product is a powerful tool for anyone who sells items with multiple options, but it confuses those who don't grasp its logic. Remember the essentials: the attribute describes, the variation sells, and the magic "Used for variations" box is the bridge between them. Choose global attributes if you need filtering, price every variation without exception, manage your stock at the right level, and watch your variation count so it doesn't explode combinatorially. With these four rules you avoid ninety percent of store problems.

Frequently asked questions

What is the difference between a simple product and a variable product in WooCommerce?

A simple product is a single item with one price and one stock level and no options. A variable product is a single item with several variations, each with its own price, stock and image. Use a variable product when the options (color/size) affect the price, stock or SKU.

Why don't my variations show up on the product page?

The most common reason is that you didn't check the "Used for variations" box on the attribute. Go back to the Attributes tab, check it for every relevant attribute, click "Save attributes", then generate the variations from the Variations tab. Another possible reason is that you haven't generated any variations yet at all.

Why is the "Add to cart" button grayed out and not working?

Because one or more variations have no regular price. The rule in WooCommerce is that any variation without a Regular price is neither displayed nor purchasable. Go through all your variations and add a price to each one; a single forgotten variation is enough to disable the button for that combination.

What is the maximum number of variations for one product?

There is no absolute maximum. The official 30-variation threshold is only a display limit: 30 or fewer gives dynamic dropdowns with AJAX filtering, and more than 30 turns them into static dropdowns. The larger numbers (100/200) often cited as the point where things slow down are third-party estimates, not an official commitment, and they depend on your server and theme.

What is the difference between a global and a custom attribute, and which is better?

A global attribute is created once under Products > Attributes and reused across your products; its values are registered terms, and filtering works only with it. A custom attribute belongs to a single product, its values are entered as text separated by |, and it cannot be filtered. For a clothing store that needs filtering by color and size, global attributes are clearly better.

Can I set a different price for each size or color?

Yes, and that is one of the main reasons to use a variable product. Each variation has its own Regular price (and an optional Sale price). So you can make size XXL more expensive than S, for example, simply by entering a different price in each variation.

How do I manage stock for each variation separately?

Check the "Manage stock?" box inside the variation itself, which opens a quantity field just for it. If you leave it unchecked, stock is managed at the parent level as a shared balance. You can mix the two: some variations with their own stock and others on the parent.

Does each variation support more than one image?

A single image per variation has been supported for a long time (it swaps the gallery when the variation is selected). A multi-image gallery per variation ("Variation Gallery"), however, is a newer feature that appeared around WooCommerce 10.9, so don't assume it is available in older versions; check your version.

When should I use a display attribute without variations instead of a variable product?

When the option is purely descriptive and doesn't affect the price, stock or SKU, such as the fabric type or the country of origin. In that case an attribute that appears in the specifications table without generating variations is enough, and you avoid weighing your product down with pointless variations.

How do I connect a payment gateway to my variable products?

Variable products are bought and paid for like any other product; they need no special payment setup. Configure your payment gateway once at the store level, as in the WooCommerce payment gateways guide, and it will automatically work with all variations.