Import Variation Data With WP All Import (Optional)

What you’ll need

In order to import WooCommerce product-based data, you’ll need WP All Import and the WooCommerce add ons. You can find these in their WooCommerce Import Package.

Preparing the Spreadsheet

To prepare your variation data for important, we recommend using Google Drive to create your spreadsheets. With Google Drive, you’ll be able to save them as CSV files for using later. 

However, the beauty of WP All Import is it accepts a variety of file types, so use whatever you feel comfortable with. To get this setup you’ll want to follow this structure and import the following fields:

  • Visibility
    A comma-separated list of visibility locations. These are catalog, search, filtered, or hidden.
  • Featured
    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 ID column.

Your spreadsheet structure should be as follows:

ID Visibility Featured Disable “Add to Cart” Title
1596 catalog,filtered,search 1 1 Variation 1
1597 catalog 1 0 Variation 2
1598 filtered,search 0 0 Variation 3

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.

With WP All Import installed, navigate to the plugin’s upload section. You can find this by going to All Import > New Import in your WordPress dashboard.

Click Upload a file to upload your CSV file. Then, choose Existing Items and select WooCommerce Products from the dropdown field.

choose WooCommerce products from dropdown

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.

In 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:

  • _visibility
  • _jck_wssv_display_title
  • _featured
  • _disable_add_to_cart

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:

example custom fields spreadsheet

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:

example of WooCommerce add-on

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.

example of import screen ready to go

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.

WooCommerce Show Single Variations

Display individual product variations of a variable product in your product listings. Make it easy for your customers to view and filter product variations.

Was this helpful?

Please let us know if this article was useful. It is the best way to ensure our documentation is as helpful as possible.