Wait!

Lifetime licenses are only available for a short time, don't miss out!

Any File Type

No need to reorganize your data, just upload your file to WP All Import and it'll sort it out.

Complete Customization

Granular control over every single piece of data. Think your import is too complicated? Think again.

Import Huge Datasets

It doesn't matter how big your site is or how much data you need to import, WP All Import can handle it. 

Multilingual Imports

Importing data to multilingual sites has never been easier, with support from the WPML team.

Scheduled Imports

Run imports automatically on a schedule. Subscribe to our point and click scheduling service, or set up cron jobs.

Developer Friendly

Write and test PHP right inside WP All Import when setting up your import, with tons of snippets to get you started.
@glitzformals
"This plugin is a game changer for my situation. I’m stunned at how fast and effortless the import process is."
@adatfalo
"I have never experienced such a quick and helpful support experience with any plugin, and by the way, the knowledge of the support colleagues is professional!"
@jessedw44
"Even if you just use this plugin once, it will save you time. If you work on several sites its invaluable. Constantly developed, and continuously supported. Great job."
90-Day Guarantee
Not 100% happy? Let us know and we’ll promptly send you a refund.
Free Updates For Life
Pay once for unlimited installs, even client sites. No renewal fees.
Fast, World Class Support
Over 9 years experience with WordPress imports and exports.
Now is your last chance to buy a lifetime license before we switch to annual pricing. Existing licenses will be unaffected.
Read More

How To Import Variable Products in WooCommerce

To import variable products, go to WP All Import › New Import, upload or choose your import file, and then select WooCommerce Products from the dropdown list. Use the drag and drop interface to configure your import template and import the variable WooCommerce products.

This documentation covers how to import WooCommerce products using WP All Import. For a broader look at importing WooCommerce products, check out:

Step 1: Create New Import

Navigate to All Import › New Import and upload/load/select your import file. In the dropdown list, choose WooCommerce Products and click Continue to Step 2.

Import Variable Products New Import

Step 2: Review Variable Product Data to Import

The Review Import File screen now appears. Validate that the import data on this screen is correct.

Import Variable Products Review Import File

With CSV files, you can change the delimiter used. With XML files, you can select the parent node to use in the import process.

On this same screen, you can Add Filtering Options to control which products to import (it uses XPath 1.0).

Click Continue to Step 3 to move to the next step.

Step 3: Map Incoming Product Data to Import Variable Products

Next up is the Drag & Drop screen, where you can build and configure the template required to import variable products. To map the data, drag and drop the import elements from the right to the appropriate import fields on the left.

Title & Description Section

First, you map the title and the description for the WooCommerce product:

Import Variable Products Drag and Drop

WooCommerce Add-On Section

Expand the WooCommerce Add-On section.

To import variable products, define the Product Type as a Variable product in the dropdown list near the top.

Import Variable Products General Tab

Then, you must configure these three tabs:

  • General tab. This is where you specify the price, as shown above. WooCommerce won’t show variations on the front end of your site unless the price is present.
  • Attributes tab. You specify the variation attributes here — for example, Size or Color.
  • Variations tab: Used to specify how to link multiple variations from your file to form a single variable product.

To learn more about the other tabs available for WooCommerce products, see: Map Incoming WooCommerce Data.

Attributes tab

The Attributes tab allows you to import variable product attributes, which you can use to create variations or sort products. You can add as many attributes as needed, select whether they are used for variations, etc.

Additional Information On Attributes to Import Variable Products

Attributes are those things that users can change to choose the variation they want. Each attribute can have multiple possible values. Users select these values to choose the particular variation they want to purchase. For example, a T-shirt can have Color and Size attributes.

Variation selections

In the example above, the two attributes are Size and Depth. Attributes are set up on the Attributes tab of the WooCommerce Add-On section.

Import Variable Products Attributes Tab

If you need to match with an existing attribute, you can use the attribute slug instead of the name, and WP All Import will attempt a direct match with any existing attribute with that slug.

If your file has many types of variable products with different attributes — for example, the T-shirts in your file have Size and Color attributes, and Posters have Canvas Size and Depth attributes — just configure all the attributes in the plugin. The attributes will be ignored if they don’t exist for a particular product in your file, so you won’t end up with T-shirts with Canvas Size and Depth attributes or Posters with Size and Color attributes.

Some attribute names are reserved. For example, you can’t use "Type". If you can’t use a certain attribute name inside of WooCommerce, you can’t use it inside WP All Import either.

Variations Tab

Below, we detail the different ways to set up the Variations tab.

Import Variable Products in WooCommerce Variations Tab

Linking Multiple Variations Together To Form A Variable Product

WooCommerce stores a variable product as a single parent product with multiple child variations.

For example, a T-shirt might have three child variations — Small, Medium, and Large.

You can import XML, CSV, or Excel files containing parent products with child variations. You can also import files that only contain product variations with no parent products.

On the Variations tab of the WooCommerce Add-On, you specify how to group multiple product variations into a single variable product. Typically, for CSV files, you’ll have one product variation per row, and for XML files, one product variation per record.

Example A – Linking Variations To Parent Based On Parent SKU

Import Variable Products Variations by Parent SKU

Download: CSV · XML

In this example, you’ll notice there are two products (a Soflyy Mug and a Soflyy T-Shirt) with two variations each (based on Color).

Our file contains both the parent products and the variations in this example.

The variations are grouped to their parent products using the SKU and Parent SKU columns. We can use the Parent SKU column to tell WP All Import to assign the variations to the parent product with an SKU that is the same as the variation’s Parent SKU.

Example B – Product Variations Grouped By A Unique Identifier

Import Variable Products Variations by Group ID

Download: CSV · XML

Here, there are two products (Coca-Cola and Sprite) with four variations each (based on Size). There are no parent products, but the variations are grouped together with the Group ID column.

Since WooCommerce requires parent products, WP All Import will automatically create the parent products for us. We can use the Group ID column to tell the plugin to group all the variations with the same Group ID into a single variable product.

Selecting this setting will enable the Manage stock? and Stock status options inside this same tab.

Example C – Variations Grouped By Title

Import Variable Products Variations by Title

Download: CSV · XML

In this example, there are two products (Wagyu Tenderloin Steak and Lamb Chops), with three variations each, based on the weight of the steak and the quantity of the lamb.

The variations are grouped together by title. We can use the Product Title column to tell WP All Import to assign the variations to the parent product that has the same title.

The Quantity attribute will be ignored for the steak, and the Weight attribute will be ignored for the lamb.

Example D – Variations Grouped By Title, No Parent Products

Import Variable Products Match Variations by Title No Parent

Download: CSV · XML

In this example, you’ll notice there are two products (Apple tree and Orange tree), with four variations each, based on the tree height and type of rootstock.

Here our file contains only variations, without parent products. WP All Import will automatically create the parent products.

The variations are grouped together by title. We can use the Product Title column to tell WP All Import to create multiple variable products, with each one containing all the variations with the same title.

Example E – Variations As Child XML Element

Use this option if you are importing an XML file and the variations are child elements of your product elements instead of separate product elements.

In the XML example below, all product variations are enclosed in an element, where one product can have any number of variants:

<Product>
	<SKU>10027105</SKU>
	<Brand_Name>Adidas</Brand_Name>
	<Product_Name>Adidas Mens Climacool Boat Lace Shoes - Sale</Product_Name>
	<Long_Description>...</Long_Description>
	<Short_Description>...</Short_Description>
	<Category>Footwear</Category>
	<SubCategory>Casual</SubCategory>
	<Product_Group>Men's</Product_Group>
	<Thumb_URL>...</Thumb_URL>
	<Image_URL>...</Image_URL>
	<Buy_Link>...</Buy_Link>
	<Retail_Price>74.99</Retail_Price>
	<Sale_Price>59.99</Sale_Price>
	<Extended_Xml_Attributes>
		<variants>
			<variant>
				<sku>19301</sku>
				<upc>0886833708180</upc>
				<size>8</size>
				<color>Dark Indigo</color>
				<retail_price>74.99</retail_price>
				<sale_price>59.99</sale_price>
				<action_url>...</action_url>
			</variant>
			<variant/>
			...
		</variants>
	</Extended_Xml_Attributes>
</Product>

You don’t need to set anything in the General or Attributes tab when importing variations in this format. You set the price and the attributes in the Variations tab directly. Though, in some cases, you may also need to set up those tabs, for example, when your file requires it or if you're also importing simple products with attributes located outside of the <variants/variant> elements (see example above).

For the plugin to detect the variations, you must define the XML elements that contain them. You can do this by dragging & dropping one of the <variant> elements into the Variations XPath box.

Import Variable Products Match XML Variations by XPath

You then set your attributes by dragging & dropping attributes from the popup XML tree containing the XML for the variation instead of using the main XML tree.

Set your price using the price in the popup XML tree if available, or if you want to set all the variation prices to the price of the parent product, you can drag the price from the main XML tree. When dragging XPath from the main XML tree to any of the boxes below Variations XPath, you must check the XPath from the Parent option.

Import Variable Products Map XML with XPath

In the screenshot above, you can see there are thirteen total variants of the current product. Configure the options for just one, and WP All Import will automatically loop through the other twelve variations and create variations for all of them.

Other Options Available in the Variations tab

Different options appear near the bottom of the Variations tab when you select any of the options above. The following options appear for all settings:

  • Variations Enabled: Enabled by default. This option is the same as the Enabled checkbox when editing an individual variation in WooCommerce. You can select Yes, No, or Set with XPath (accepts yes or no).
  • Set the default selection in the attributes dropdowns: Disabled by default. When enabled, you can have either the first variation, the first in stock, or define the default attributes via XPath (accepts only serialized data, such as a:2:{s:7:"pa_size";s:3:"6-5";s:8:"pa_color";s:3:"red";}).
  • Do not set default selections for the dropdowns: Self-explanatory. Enabled by default.
  • Create products with no variations as simple products: Enabled by default. It should be disabled to create a variable product even when the product contains just one variation.
  • Save variation image to the gallery: Disabled by default. Enable it to save variation images to the product gallery, too.

Images section

Images found in the parent record get imported to the product. The first image is assigned as the featured image when the Set the first image to the Featured Image (_thumbnail_id) option is enabled. All other images are added to the product gallery.

Images found in the variation record are imported to the variation itself. To save these images to the product gallery, enable the option Save variation image to the gallery in the Variations tab.

Multiple variation images are not supported out-of-the-box but can be enabled with third-party plugins. Whenever any of the following plugins are active:

The option Import additional variation images appears in the Variations tab:

Import Variable Products Add Additional Variation Images

That option processes the multiple variation images and adds them as needed to the installed plugin.

If you use a different plugin to enable multiple variation images, you can write custom code that uses our pmxi_gallery_image hook to import the images into it.

Other sections

Other sections are available such as Custom FieldsOther Product Options, etc., but we won't cover much from those in this guide.

To import custom fields to variations, you can add them to the Custom Fields section when using all options in the Variations tab, except for Example D – Variations As Child XML Element, where you would need to use custom code to import custom fields correctly.

Once you're done setting up the import template, proceed to click on Continue to Step 4 (not shown) at the bottom.

Step 4: Configure Variable Product's Import Settings

This is the Import Settings screen. Here, you can change different import configurations.

First, click on Auto-detect to generate a unique identifier for the import. If needed, you can build this identifier by using import elements.

Import Variable Products Import Settings

You can tell WP All Import what to do when this import is run again in the following panels. Specifically, you can modify the behavior to either update, delete or create products.

You can also find two panels near the bottom, one to set up Scheduling Options and the other to Configure Advanced Settings. For now, you can leave the default selections in both.

To move on to the next step, click Continue.

Step 5: Run Import and Verify Imported Variable Products

The Confirm & Run screen appears. Here, you can review an import summary:

Import Variable Products Confirm and Run

After verifying everything is correct, click on Confirm & Run Import to finish the import process.

You'll see the following screen once the import completes:

Import Variable Products Import Complete

Navigate to Products › All Products in the WordPress menu to review if all products were imported correctly:

Import Variable Products Review Products

That's it! You've successfully imported variable products in WooCommerce.

Import Variable Products – Advanced Topics

Importing Simple And Variable Products At The Same Time

Configure your import as if you were only importing variable products.

WP All Import will automatically create simple products for products that have no variations or only a single variation when the Create products with no variations as simple products option is active in the Variations tab:

Import Variable Products Create Products With No Variations As Simple

To avoid this behavior and import all products as a variable product, even when they have just one variation, simply disable this setting.

Setting Up An Excel File To Import Product Variations (Video)

Maybe you want to manually create a file containing your variations because you don’t already have a point of sale or inventory management system that does it for you, or you don’t have a product feed from a drop-shipper or affiliate network. Sad days… but here’s how to do it using Excel:

On the Attributes tab, you'll notice a Link All Variations option. If the data for your variations is stored in a single row, use this option. It works just like the Link All Variations option inside WooCommerce.

Link all variations

In the above example, Baseball Cap is a product with 3 color variations, and Mug is one with 2 color variations.

A pipe symbol – | separates each color.

The WooCommerce Import Add-On will automatically generate variations for each color using the settings below.

Import Variable Products Link All Variations

When this option is activated, the Variations tab will disappear.

If your file uses something other than a | as a separator, you can use a PHP function to replace it with a |.

For example, if you had a Color column containing Red,Blue,Green you’d replace the commas with pipes like this:

[str_replace(",", "|", {Color[1]})]

Enable Variation Stock While Disabling Parent Product Stock Management

When using Example A or Example C and setting up product stock, you may want to keep stock management enabled for simple products or at the variation level only, while disabling stock management at the parent product level. That can be achieved using custom code along with our API. Here's a working snippet:

 
// No manage stock for parent variable products. Keep manage stock for simple products.
// Do not set parent Stock
add_action( 'wp_all_import_variable_product_imported', 'parent_no_stock', 10, 1 );
function parent_no_stock( $id ) {
    // Optional: only run for certain import ID
    // $import_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) );
    // if ( $import_id != '25' ) return;

	$is_converted = get_post_meta($id, '_wpai_converted_to_simple', true);	
	if ( empty($is_converted) ) {
		$prod = wc_get_product( $id );
		$prod->set_manage_stock( false );
		$prod->save();
	}
}

add_action( 'wp_all_import_make_product_simple', 'my_wpai_simple_product_func', 10, 2 );
function my_wpai_simple_product_func( $prod_id, $import_id ) {
    // Optional: only run for certain import ID
    // $import_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) );
    // if ( $import_id != '25' ) return;	
	update_post_meta($prod_id, '_wpai_converted_to_simple', 1);
}

Importing Variations From CSV or XML (Video)

Import Variable Products From XML to WooCommerce with Child XML Elements (Video)

Frequently Asked Questions

How to Add New Variations to Existing Variable Products?

  1. Create a New Import via All Import › New Import.
  2. Select New Items as the import type.
  3. Upload the import file with the new variations.
  4. Set up a variable product's import and use the I'm importing new variations to existing products option in the Variations tab.
  5. Process the import and review that all new variations are added as expected.

This is only possible with a New Items import, and the option described above won't appear with an Existing Items import. You can match with an existing variable parent product using any custom field or the product's title. You can also Create new product if no existing product is found.

How to Add New Variations Using Bulk Edit Process?

  1. Create a new WooCommerce product export using WP All Export.
  2. Modify the exported products to add the new variations as desired.
  3. Ensure the variations comply with the same format in the existing sheet. If there are no variable products, just ensure that the parent row is above all the variations that belong to it (see Example A above for reference).
  4. Use the Import with WP All Import option in All Export › Manage Exports.
  5. Leave the configurations as-is and proceed to re-import the products.

Using the instructions above, you can generate a new export file with all WooCommerce products, add the new variations to that file, and then re-import everything to add new variations to existing products. See How to Bulk Edit WooCommerce Products in Simple Steps to learn more.

What's the Correct Way to Handle Variable Products?

Variable products get stored in a certain way. To avoid issues or damaging your products, you should have a master import that you can re-run and allows handling all products from a single master file.

You should use a New Items import type, as it's the only import type that can add/remove variations for variable products. That way, you can add/remove/edit variations without damaging the variable product itself.

Related Docs

Learn how to import WooCommerce products using WP All Import.

Export any WooCommerce products that you want with WP All Export.

Learn how to migrate WooCommerce products using WP All Import and WP All Export.

Related Videos

Lifetime support. Lifetime updates. Pay once.

Packages
Standalone
Import
Pro Package
$249
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Import + Export Pro Package
$299
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
WooCommerce Import Package
$149
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Import Standalone
$99
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Import + Export Standalone
$169
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Export Standalone
$99
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
cross