Import Variable Products and Variations
Variable products show customers a set of choices (for example Size and Colour). In Import WP you typically import:
- A variable parent product with attributes marked for variations
- Separate variation rows linked to that parent
This is the most common WooCommerce support topic. Follow the checklist at the end of this article if variations fail to import.
Table of Contents
How variable products work in Import WP
| Row in your file | Product Type value | Role |
|---|---|---|
| Parent | variable | Holds the product name, description, attributes, categories, gallery |
| Child | variation | Holds one combination of attribute values, plus price / SKU / stock |
Variations are linked to the parent using Advanced → Parent (usually by parent SKU).
Example CSV
| Name | SKU | Product Type | Price | Parent | Colour |
|---|---|---|---|---|---|
| Variable Product 1 | variable-one | variable | red,blue | ||
| Product Variation 1 | variation-one | variation | 10.99 | variable-one | red |
| Product Variation 2 | variation-two | variation | 12.99 | variable-one | blue |
Step 1 — Import the variable parent
On the parent row:
- Set Product Type to
variable(or “Variable product”). - Map Product Name and Product SKU.
- Under Product Attributes, add a row for each attribute (for example Colour):
- Name —
Colour(orColor) - Terms — all possible values for this product, e.g.
red,blue - Is Global? —
Yesif the attribute exists (or should exist) under Products → Attributes; otherwiseNofor a product-level attribute - Used for variations? — Yes (required for variation attributes)
- Is Visible? —
Yesif the attribute should show on the product page
- Name —
You can import the parent in the same file as the variations, or in a separate importer that runs first.
Step 2 — Import the variations
On each variation row:
- Set Product Type to
variation(shown as “Product Variation”). - Map Product SKU (unique per variation).
- Map Regular Price (and stock if needed) on the variation row — not only on the parent.
- Under Advanced, enable Parent Settings:
- Parent — the parent product’s SKU (e.g.
variable-one) - Parent Field Type —
Sku(or ID / Slug / Name / Reference Column)
- Parent — the parent product’s SKU (e.g.
- Under Product Attributes, map the same attribute Name as the parent, with Terms set to the single value for that variation (e.g.
red).- Leave Used for variations? blank or set to Yes (do not set No on variation rows for attributes that define the variation).
- Match Is Global? with the parent.
On variation rows, only the first term is used if you pass a comma-separated list. Each variation should have one value per variation attribute.
Parent linking options
| Parent Field Type | Parent value example |
|---|---|
| Sku | variable-one |
| ID | 123 |
| Slug | variable-product-1 |
| Name | Variable Product 1 |
| Reference Column | A column value stored as a reference when the parent was imported |
SKU is usually the most reliable when your feed already includes a parent SKU column.
Multiple attributes (Size + Colour)
Example with two variation attributes:
| Name | SKU | Product Type | Price | Parent | Colour | Size |
|---|---|---|---|---|---|---|
| T-Shirt | tee-parent | variable | red,blue | S,M,L | ||
| T-Shirt – Red S | tee-red-s | variation | 19.99 | tee-parent | red | S |
| T-Shirt – Red M | tee-red-m | variation | 19.99 | tee-parent | red | M |
| T-Shirt – Blue S | tee-blue-s | variation | 21.99 | tee-parent | blue | S |
Map two Product Attribute rows on both parent and variation records (Colour and Size). On the parent, list all terms; on each variation, set the single Colour and Size for that row.
Where price and stock live
| Data | Parent | Variation |
|---|---|---|
| Name / description / categories / gallery | Yes | Usually inherit / optional |
| Attributes used for variations | Yes (all terms) | Yes (single term per attribute) |
| Regular / sale price | Optional | Yes — set on each variation |
| SKU | Parent SKU | Unique variation SKU |
| Stock quantity / status | Optional | Typically on each variation |
If prices only appear on the parent and variations have no price, WooCommerce will not sell those variations correctly.
Import order matters
- On insert, the parent must already exist or appear earlier in the same import. Otherwise you may see:
“Variation cannot be imported: Missing parent ID or parent does not exist yet.” - Prefer importing all parents first, then variations (two importers, or sort the file so parents come first).
- On update, a variation that already has a parent can still update even if the parent lookup temporarily fails.
XML feeds with nested variations
Most XML feeds work best when each variation is a separate record (same pattern as CSV).
Some XML feeds nest variation nodes under the parent. Import WP can process inline XML variations when configured via the iwp/woocommerce/xml_child_variation_attributes filter. See WooCommerce Filters and Code Snippets.
Checklist
Use this when variations fail or show “Please, provide an attribute name”:
- Parent Product Type is
variable - Variation Product Type is
variation - Parent attributes have a non-empty Name
- Parent attributes have Used for variations? = Yes
- Parent lists all attribute terms the variations will use
- Each variation maps the same attribute names with a single term value
- Is Global? matches between parent and variation
- Advanced → Parent is set (usually Parent Field Type = Sku)
- Parent exists before the variation is inserted
- Each variation has its own SKU and Regular Price
- Permissions allow Create and/or Update as needed
- Unique identifier is set (usually Product SKU)