How to add a variable product (sizes, colors)
Step-by-step guide to creating a WooCommerce variable product with attributes like size and color, and setting prices and stock for each variation.
- Time
- 15–20 minutes
- Difficulty
- Intermediate
- You’ll need
- WordPress admin access · Your list of product options and prices
A variable product lets customers choose between options — like size, color, or material — before adding an item to their cart. This guide walks you through setting one up from scratch.
Quick summary
A variable product has attributes (like "Size") and variations (like Small, Medium, Large). You create the attributes first, then generate the variations and set a price for each one. Plan your options before you start — it makes the process much smoother.
What you'll need
- WordPress admin access (Administrator or Shop Manager role)
- A list of the options you offer (e.g., sizes: S, M, L, XL — colors: Red, Blue, Green)
- A price for each combination (you can use one price for all if they are the same)
Understanding the terminology
Before you start, two terms to know:
- Attribute — the type of option (e.g., "Size" or "Color")
- Variation — one specific combination of attributes (e.g., Size: Medium, Color: Blue)
Step-by-step: creating a variable product
Go to Products → Add New. Fill in the product name, long description, short description, image, categories, and tags just as you would for a simple product. See How to add a simple product for those steps.
Change the product type to Variable product. In the Product data panel, open the dropdown at the top and select Variable product. A Variations tab appears in the panel, alongside the Attributes tab.
Go to the Attributes tab. Click the Attributes tab inside the Product data panel. You will see an Add new button, plus a dropdown for attributes you have already set up under Products → Attributes (in WooCommerce 11.1 it reads Add global; Woo's docs still call it Add existing).
Add your first attribute. Click Add new. A new form appears. Type in the attribute Name (e.g., "Size"). In the Value(s) field, enter each option separated by a vertical bar character (|) — for example: Small | Medium | Large | X-Large.
Make sure the Used for variations checkbox is ticked. Click Save attributes.
Add any additional attributes. If your product has more than one option dimension (e.g., both Size and Color), click Add new again and repeat for the next attribute.
Go to the Variations tab. Click the Variations tab, then click Generate variations. WooCommerce will create every combination of your attribute values automatically. (To create only some combinations, click Add manually instead.)
Set prices for each variation. Each variation now appears as a row you can expand by clicking it. At minimum, you need to fill in the Regular price for each — it is required. You can also set a sale price, manage individual stock levels, and upload variation-specific images.
Save your changes. Click Save changes at the bottom of the Variations tab to save all variation data.
Publish the product. Click Publish (or Update if you are editing an existing product). Customers can now choose their options on the product page.
Don't forget to set prices
A variation without a price doesn't show in your store, so customers can't choose it. If you generate many variations, make sure every single one has a price set before publishing.
Setting a single price for all variations
If all your variations cost the same price, you do not need to set each one individually. Click the Variations tab, open the Bulk actions dropdown at the top, choose Set regular prices, and enter the price in the pop-up. WooCommerce will apply it to every variation at once and save the change straight away.
Adding variation-specific images
Each variation can have its own image, which swaps in automatically when the customer picks that option. Inside each variation row, click the image placeholder to upload or select a photo. Since WooCommerce 11.1, a variation can also have several images: click Manage next to Variation gallery and choose them. Click Save changes when you're done.
Managing stock per variation
You can track stock separately for each variation. Inside each variation row, check Manage stock? and enter the current Stock quantity. (The Manage stock? box only appears if stock management is switched on for the whole store under WooCommerce → Settings → Products → Inventory.) When a variation runs out, WooCommerce marks it as out of stock.
See Managing stock & inventory for more.
Common questions
I created my attributes but the Variations tab shows nothing — what went wrong?
Check that you ticked Used for variations on each attribute before saving. If you forgot, go back to the Attributes tab, tick the checkbox, save, then return to Variations and generate variations again.
How many variations can a product have?
Large numbers of variations can slow things down. By default, once a product has more than 30 variations, the option dropdowns on the product page stop updating as the customer makes choices (this keeps the page fast), so a customer can pick a combination you don't sell and see a "no products matched" message. If you have a huge range of options, consider splitting into separate products or using a plugin designed for large catalogs.
Can I hide a variation that is out of stock instead of showing it as unavailable?
By default, out-of-stock variations still appear in the options, and a customer who picks one sees an "unavailable" or "out of stock" message. To hide them, go to WooCommerce → Settings → Products → Inventory and tick Hide out of stock items from the catalog. This only hides a variation if its stock is managed at the variation level, it is out of stock, and backorders are turned off for it.
Can I set a different price for one size but keep all other sizes the same price?
Yes. Expand that variation's row in the Variations tab and set its price individually. All other variations keep their own prices.
Related guides
- Products in WooCommerce explained
- How to add a simple product
- Product images & galleries
- Managing stock & inventory
- Setting prices & sale prices
- My changes aren't showing up
Need a hand?
Learn more
Last updated
How to add a simple product
Step-by-step instructions for creating a simple product in WooCommerce, including name, price, description, image, and publishing.
Selling digital & downloadable products
How to set up and sell digital downloads in WooCommerce — including uploading files, setting download limits, and how customers receive their files.