Import variation data with WP All import (Optional)
In order to import WooCommerce product based data, you will need WP All Import and the WooCommerce add ons.
Preparing the Spreadsheet
I use Google Drive for creating my spreadsheets, saving them as CSV files. However, the beauty of WP All Import is it accepts a variety of file types, so use whatever you feel comfortable with, but follow this structure.
You are able to import the following fields:
A comma separated list of visibility locations. These are catalog, search, filtered, or hidden.
1 for true, 0 for false.
- Disable “Add to Cart”
1 for true, 0 for false.
- Display Title
The title of your variation in the catalog. Don’t import this column if you want to keep the parent product title.
The following example assumes you are *updating* an existing set of variations, so I’ll also have an
Your spreadsheet structure should be as follows:
|ID||Visibility||Featured||Disable "Add to Cart"||Title|
Importing the Variation Data
Importing the variation data is simple. Now that you’ve prepared and saved your spreadsheet as a CSV file, let’s import it into WordPress.
Firstly, upload your CSV file. Then, choose Existing Items and select WooCommerce Products from the dropdown field.
Click Continue to Step 2.
Step 2 should show you a well formatted list of your variation data. Assuming all looks good, click Continue to Step 3.
On Step 3, we’re only going to be importing custom field data. Click the Custom Fields tab. We want to add 4 custom fields, these are:
Add those rows, and click and drag the relevant column titles ( the green text ) from the right hand side spreadsheet overview. It should now look like this:
Since WooCommerce 3.0.0, the visibility settings are now handled using taxonomy data, rather than meta data. However, Show Single Variations still requires the meta data. As such, we will also import the visibility settings to another field.
Click WooCommerce Add-On. Then click the Advanced tab. Under Catalog visibility click Set with XPath. Drag your visibility column title into the field. it will look like this:
You can save these settings to use again, by checking the Save settings as template field and giving it a name. Click Continue to Step 4.
As we’re updating existing items, we want to match variations by Post ID. Click Post ID and drag the id column heading into the input field.
Next, we want to make sure that it *only* updates those 4 custom fields and the visibility settings, and nothing else. Uncheck Create new posts from records newly present in your file. Check Update existing posts with changed data in your file and make sure Choose which data to update is selected. Unselect all except Custom Fields and Advanced WooCommerce Options.
For Advanced WooCommerce Options, check the Update Catalog Visibility field.
For Custom Fields, choose Update only these Custom Fields, leave the rest alone and enter the custom field names from before into the field, pressing Enter after each one.
You will see a warning when you enter the custom fields, "As of WooCommerce 3.0 this data is no longer stored as a custom field". You can safely ignore this, the import will work as expected.
We’re good to go! Click Continue, check the Import Summary, and then click Confirm & Run Import.
Your variation data will now be processed accordingly.