Docs

Import Variable Products and Variations

Variable products show customers a set of choices (for example Size and Colour). In Import WP you typically import:

  1. A variable parent product with attributes marked for variations
  2. 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.

How variable products work in Import WP

Row in your fileProduct Type valueRole
ParentvariableHolds the product name, description, attributes, categories, gallery
ChildvariationHolds one combination of attribute values, plus price / SKU / stock

Variations are linked to the parent using Advanced → Parent (usually by parent SKU).

Example CSV

NameSKUProduct TypePriceParentColour
Variable Product 1variable-onevariablered,blue
Product Variation 1variation-onevariation10.99variable-onered
Product Variation 2variation-twovariation12.99variable-oneblue

Step 1 — Import the variable parent

On the parent row:

  1. Set Product Type to variable (or “Variable product”).
  2. Map Product Name and Product SKU.
  3. Under Product Attributes, add a row for each attribute (for example Colour):
    • NameColour (or Color)
    • Terms — all possible values for this product, e.g. red,blue
    • Is Global?Yes if the attribute exists (or should exist) under Products → Attributes; otherwise No for a product-level attribute
    • Used for variations?Yes (required for variation attributes)
    • Is Visible?Yes if the attribute should show on the product page

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:

  1. Set Product Type to variation (shown as “Product Variation”).
  2. Map Product SKU (unique per variation).
  3. Map Regular Price (and stock if needed) on the variation row — not only on the parent.
  4. Under Advanced, enable Parent Settings:
    • Parent — the parent product’s SKU (e.g. variable-one)
    • Parent Field TypeSku (or ID / Slug / Name / Reference Column)
  5. 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 TypeParent value example
Skuvariable-one
ID123
Slugvariable-product-1
NameVariable Product 1
Reference ColumnA 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:

NameSKUProduct TypePriceParentColourSize
T-Shirttee-parentvariablered,blueS,M,L
T-Shirt – Red Stee-red-svariation19.99tee-parentredS
T-Shirt – Red Mtee-red-mvariation19.99tee-parentredM
T-Shirt – Blue Stee-blue-svariation21.99tee-parentblueS

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

DataParentVariation
Name / description / categories / galleryYesUsually inherit / optional
Attributes used for variationsYes (all terms)Yes (single term per attribute)
Regular / sale priceOptionalYes — set on each variation
SKUParent SKUUnique variation SKU
Stock quantity / statusOptionalTypically 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)