Product CSV Importer and Exporter

WooCommerce has a built-in product CSV importer and exporter which can accessed from the All Products > Products page. You can import (sometimes called merge), export, or bulk update hundreds or thousands of products in your WooCommerce store with a single CSV. This tool supports most product types, including variations.

Locate the Import / Export Tool

↑ Back to top

The Import and Export options are placed right next to the “Add New” Product button.

  • First-time store owners get started more quickly by exporting and importing products during setup.
  • Existing store owners can update tens or hundreds of products with new info or place them on sale, or sync multiple storefronts.
Note: If you are using the paid extension `Product CSV Import Suite`, refer to documentation at: Product CSV Import Suite.

Create your CSV

↑ Back to top

What CSV editors do you recommend?

↑ Back to top

We recommend using:

If possible, avoid Microsoft Excel due to formatting and character encoding issues. But regardless of what tool you use, always ensure you export as a CSV file.

How to create the CSV?

↑ Back to top

To import new products or update existing products, you need a CSV containing your product information. You can:

Note: If using the built-in WooCommerce Product CSV Importer and Exporter tool to export a CSV, it already follows the schema and is ready to use.

If using the blank and formatted CSV file, it also follows the schema; just be sure to enter the info as instructed at Product CSV Import Schema.

General guidelines

↑ Back to top
  • CSVs should be in UTF-8 format.
  • Dates should be defined for the store’s local timezone.
  • Use 1 or 0 in your CSV, if importing a Boolean value (true or false).
  • Multiple values in a field get separated with commas.
  • Wrapping values in quotes allows you to insert a comma.
  • Prefix the id with id: if referencing an existing product ID. No prefix is needed if referencing a SKU. For example: id:100, SKU101.
  • Taxonomy term hierarchy is denoted with >, terms are separated with commas.
  • Draft products are not exported, only published and privately published products.
  • It is not possible to assign a specific post ID to product on import. Products will always use the next available ID, regardless of the ID included in the imported CSV.

Images

↑ Back to top
  • Images need to be pre-uploaded or available online to import to your store.
  • External URLs are supported and imported into the Media Library if used, provided the images are directly accessible and not behind a redirect script (as happens on some cloud storage services).
  • You can define the filename if the image already exists in the Media Library.
  • The core CSV importer does not currently have the ability to add, edit or update alt text for product images.

Import

↑ Back to top

Adding New Products

↑ Back to top

First-time and existing store owners using WooCommerce can use the CSV to add new products with one upload.

  1. Go to All Products > Products.
  2. Select Import at the top. The Upload CSV File screen displays.
  1. Select Choose File and the CSV you wish you use.
  2. CSV delimiter (Advanced option): Generally CSV elements are separated by a comma. If you are using a different delimiter in your file, you can set it here.
  3. Click on the Continue button
  4. The Column Mapping screen displays, WooCommerce automatically attempts to match or map the Column Name from your CSV to Fields.
  1. Use dropdown menus on the right side to adjust fields or indicate ‘Do not import.’
  2. Any unrecognized columns will not be imported by default.
  1. Once you are ready, click on the Run the Importer button.
  1. Wait until the Importer is finished. Do not refresh or navigate away from this page while the import is in progress.

Update Existing Products

↑ Back to top

Store owners can use the CSV importer tool to bulk update existing products with new info, e.g., adding a brand, changing a tax class, bulk updates for a special sale or event, etc.

  1. Make a CSV file as indicated in the Create Your CSV section, using the IDs and/or SKUs of products you wish to update. The importer uses the ID and/or SKU from the CSV to match and update products in your shop.
  1. Navigate to All Products > Products.
  2. Click on the Import button at the top. The Upload CSV File screen displays.
  1. Select Choose File and the CSV you wish you use.
  2. Tick the checkbox to Update Existing Products.
  1. Click on the Continue button.
  2. The Column Mapping screen displays and WooCommerce automatically attempts to match or “map” the Column Name from your CSV to Fields.
  1. Use dropdown menus on the right side to adjust fields or indicate ‘Do not import.
  2. Any unrecognized columns will not be imported by default.
  1. Click on the Run the Importer button.
  1. Wait until the Importer is finished. Do not refresh or navigate away from this page while the import is in progress.

Your product import is complete!

Converting existing Simple Product to Variable Product

↑ Back to top

Store owners can use the CSV Importer tool to convert an existing simple product to a variable product. To do so, follow the below steps:

  1. Create a simple product that has a price and SKU.
  2. Export product via built-in CSV Exporter on the All Products page.
  3. Open the CSV file and convert the simple product to a variable by following the below steps:

In this example, we will convert a simple product into a variable product with 1 attribute (size) and 2 variations:

  1. Add 2 new rows, one for each product variation. Leave the initial product’s row in place.
  2. Add 4 new columns after the last column. Give the columns the following headings :
    • Attribute 1 name
    • Attribute 1 value(s)
    • Attribute 1 visible
    • Attribute 1 global
  3. Add Size for the three rows in the Attribute 1 name column.
  4. Add the attribute values in the Attribute 1 value(s) column
    • In the row for the simple product, add all available attribute values. In this example we’ve added S, M as attribute values for the product.
    • In the first new variation’s row, add S as the attribute value.
    • In the second new variation’s row, add M as the attribute value.
  5. Enter 1 for each row in the Attribute 1 visible column. This is marking the attribute as visible.
  6. Enter 0 for each row in the Attribute 1 global column. This is marking the Is attribute global? field false and means the attribute will only be added to this variable product, and won’t be created globally for reuse on other products.

So far our new 4 columns look as follows:

  1. In the Type column, change the type of the product from simple to variable and add type variation to variation rows (2 new rows that you created).
  2. Add a SKU to variation rows.
  3. Give the new variations a name as well. It looks like this in our example:
A spreadsheet showing, three rows and 7 columns. In the `Type` column the top row's value is variable, the bottom two rows are variation. Each row has a unique value for SKU and Name columns.
  1. Update the other columns as well (and any other columns if needed):
  1. Important: Add a SKU to all variation rows in the Parent column – this is to map the parent product with its variations:
  1. Save a new CSV file.
  2. Import the updated CSV file back to the site using the built-in CSV Importer
  3. Select to update existing products option before running the import since we want to update the existing product on the site:
  1. Click on the “Continue” button to proceed with import (nothing to be mapped).
  2. You will see the following which is expected:
  1. Navigate to the product. You will see that it is now variable and has 1 attribute added but no variations were created. Note that Used for variations checkbox is not selected. This is also expected:
  1. Open the CSV file again (the one where you already created rows for variations) and delete the parent product row. Leave variations rows without changes:
  1. Save the updated CSV file.
  2. Next, import the updated CSV file to the site but this time don’t select the box next to Update existing products:
  1. Proceed with import (no fields need to be mapped). You should see that variations have been imported:
  1. After the import is completed, navigate to the product. It will now be a variable product with variations:

Export

↑ Back to top

Store owners wishing to export their current catalog of products for any reason can generate a CSV export using the built in product importer/exporter tool.

  1. Navigate to All Products > Products.
  2. Click on the Export button at the top. The Export Products screen will be displayed.
  1. Select to Export All Columns. Or select which columns to export by using the dropdown menu.
  1. Select to Export All Products. Or select which product types to export by using the dropdown menu.
  1. Select to Export All Categories. Or select which categories to export by using the dropdown menu.
  1. Tick the box to Export Custom Meta, if you need this info. Metadata on your products is typically from other plugins. Metadata columns are exported with meta:-prefixed to the metadata. For example, if you have metadata under the “product_depth” key, a column named meta:product_depth will be exported with those values. By default, no additional metadata is exported.
  2. Click on the Generate CSV button and wait for the export to finish.

Your products are exported and the CSV will be downloaded by your browser

Product CSV Import Schema

↑ Back to top

This is the schema used for the built-in CSV importer and exporter in WooCommerce (you can review the schema in full-page on our GitHub repository).

CSV Column NameMaps to product propertyExampleNotes
IDid100Defining this will overwrite data for that ID on import.
Typetypesimplevariation, virtualProduct Type. Valid values: simple, variable, grouped, external, variation, virtual, downloadable. Multiple types can be used CSV separated.
SKUskumy-skuRequired. Auto-generated if missing.
NamenameMy Product NameRequired.
Publishedstatus1 1 for published, 0 for private, -1 for draft.
Is featured?featured11 or 0 (1 for true, 0 for false)
Visibility in catalogcatalog_visibilityvisibleSupported values: visiblecatalogsearchhidden
Short descriptionshort_descriptionThis is a product.
DescriptiondescriptionThis is more information about a product.
Date sale price startsdate_on_sale_from2013-06-07Date (start of day) or leave blank.
Date sale price endsdate_on_sale_to2013-06-07Date (end of day) or leave blank.
Tax statustax_statustaxableSupported values: taxableshippingnone
Tax classtax_classstandardCan use any existing tax class.
In stock?stock_status11 or 0 (1 for true, 0 for false)
Stockmanage_stock / stock_quantity20Numeric stock level enables stock management. parent can be used for variations. Blank = no stock management.
Low stock amountlow_stock_amount3Empty or a number
Backorders allowed?backorders11, 0, or notify (1 for true, 0 for false)
Sold individually?sold_individually11 or 0 (1 for true, 0 for false)
Weight (unit)weight100Parse only numbers.
Length (unit)length20Parse only numbers.
Width (unit)width20Parse only numbers.
Height (unit)height20Parse only numbers.
Allow customer reviews?reviews_allowed11 or 0 (1 for true, 0 for false)
Purchase Notepurchase_noteThanks for buying it buddy.
Sale pricesale_price20.99Sale price.
Regular priceregular_price24.99Regular price.
Categoriescategory_idsCategory 1, Category 1 > Category 2CSV list of categories. > used for hierarchy.
Tagstag_idsTag 1, Tag 2CSV list of tags.
Shipping classshipping_class_idNameName of shipping class
Imagesimage_id / gallery_image_idshttp://somewhere.com/image.jpg, http://somewhere.com/image2.jpgFirst is the featured image.
Download limitdownload_limit1n/a or a limit.
Download expiry daysdownload_expiry1n/a or a day limit.
Parentparent_idid:100SKU-1Set parent ID. Used for variations. Can be just a numeric ID e.g. id:100 or a SKU. Export will use SKU when possible.
Grouped productschildrenid:100, id:101SKU-1, SKU-2List of IDs. Can be just a numeric ID e.g. id:100 or a SKU. Export will use SKU when possible.
Upsellsupsell_idsid:100, id:101SKU-1, SKU-2List of IDs. Can be just a numeric ID e.g. id:100 or a SKU. Export will use SKU when possible.
Cross-sellscross_sell_idsid:100, id:101SKU-1, SKU-2List of IDs. Can be just a numeric ID e.g. id:100 or a SKU. Export will use SKU when possible.
External URLproduct_urlhttps://mercantile.wordpress.org/product/wordpress-pennant/Product external URL.
Button textbutton_textBuy on the WordPress swag store!Custom product “buy” button.
Positionmenu_order1Menu order, used for sorting.
Attribute 1 nameattributesColorLooks for global attribute or uses text if not found. Include as many as needed. “Used for variations” is set automatically.
Attribute 1 value(s)attributesBlue, Red, GreenList of values. Variations only need 1 value. First is used if multiple get provided.
Attribute 1 defaultdefault_attributesBlueDefault value for variable products.
Attribute 1 visibleattributes11 or 0. (1 for true, 0 for false) Mapping screen labels this as “Attribute Visibility”
Attribute 1 globalattributes11 or 0. (1 for true, 0 for false) Mapping screen labels this as “Is a global attribute?”
Download 1 namedownloadsDownload 1
Download 1 URLdownloadsurl.zip

FAQ

↑ Back to top

Is it possible to add custom import columns?

↑ Back to top

Yes. Feel free to visit the WooCommerce repo at GitHub to see the custom code at Adding Custom Import Columns. Be aware that is Developer level info for which we provide no assistance under our Support Policy.

Is it possible to add custom export columns?

↑ Back to top

Yes. Feel free to visit the WooCommerce repo at GitHub to see the custom code at Adding Custom Export Columns. Be aware that this is Developer level info for which we provide no assistance under our Support Policy.

Why aren’t all my products exported?

↑ Back to top

Previous to WooCommerce 3.6.5, only products with a status of ‘publish’ or ‘private’ were exported, not those in ‘draft.’ If you want to change that, there’s a filter you can use, but this would require custom coding, which we can’t provide assistance with.

If you’re using the current version of WooCommerce and all your products aren’t exporting, check your WooCommerce logs for error messages. It may be that a plugin conflict is causing an error.

Why aren’t all of my products imported?

↑ Back to top

Previous to WooCommerce 3.6.5, only products with a status of ‘publish’ or ‘private’ were imported, not those in ‘draft.’ As of WooCommerce 3.7, CSV product import now allows true/false values for the published field, as well as the original 0 (private), -1 (draft), 1 (publish) values.

If you’re using the current version of WooCommerce and all your products aren’t importing, check the import log for error messages. It may be that a product already exists with the SKU you’re trying to use, a plugin conflict could be causing an error, or you may need to split your csv into smaller files for your server to handle the import successfully.

Permission error when importing?

↑ Back to top

Are you seeing the following permission error when importing your CSV file?
Sorry, this file type is not permitted for security reasons.

When an import file contains HTML the file type can be mis-detected by WordPress on some servers. One workaround is to add the following line to your wp-config.php file:
define( 'ALLOW_UNFILTERED_UPLOADS', true );

For security reasons, you should only enable this temporarily for the duration of the import, and then remove it again from the configuration file.

Alternatively, instead of Choose a CSV file from your computer, you can first upload the CSV file to your website’s upload directory via FTP or your host’s admin panel file manager. Then, via Advanced Options, specify the location of that file for upload:

How to increase the CSV import maximum size?

↑ Back to top

The Maximum size value is set at the server level. To increase the maximum file size, please contact your hosting company. As a workaround, you can split the CSV into multiple parts to upload separately.

How to import a large product database?

↑ Back to top

When stores need to import a large number of products, the performance of your server becomes crucial. To ensure a smooth import process when using a CSV file, consider breaking it into smaller batches. This reduces the chances of errors and allows for easier troubleshooting if issues occur.

For handling extensive imports, we recommend using the Product CSV Import Suite. This extension supports the import of thousands of products, including complex ones and custom data from extensions like Product Vendors, Brands, Google Product Feed, and more.

Questions and support

↑ Back to top

Do you still have questions and need assistance? 

This documentation is about the free, core WooCommerce plugin, for which support is provided in our community forums on WordPress.org. By searching this forum, you’ll often find that your question has been asked and answered before.

If you haven’t created a WordPress.org account to use the forums, here’s how.

  • If you’re looking to extend the core functionality shown here, we recommend reviewing available extensions in the WooCommerce Marketplace.
  • Need ongoing advanced support or a customization built for WooCommerce? Hire a Woo Agency Partner.
  • Are you a developer building your own WooCommerce integration or extension? Check our Developer Resources.

If you weren’t able to find the information you need, please use the feedback thumbs below to let us know.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.