Product CSV Importer and Exporter

The CSV import and export tool in WooCommerce is a powerful feature designed to streamline the management of your online store’s product and customer data. This tool allows store owners to easily import large volumes of products in bulk, including their attributes, categories, and images, directly into WooCommerce using a CSV file. Additionally, it supports the export of product and customer data, enabling seamless data migration, backup, and analysis. With its user-friendly interface and flexibility, the CSV import and export tool simplifies the process of updating and maintaining your store’s inventory, ensuring efficient data handling and improved store operations.

Locate the Import / Export Tool

↑ Back to top

To get started importing or exporting products, head to Products > All Products. There you’ll see Import and Export buttons 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 our premium 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, we recommend avoiding Microsoft Excel, as we’ve seen it have formatting and character encoding issues. But regardless of what tool you use, always ensure you export as a CSV file, following the guidelines below.

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.
    • See Comma handling section below if importing category names with commas in them.
  • 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 a product on import. Products will always use the next available ID, regardless of the ID included in the imported CSV.

Comma handling

↑ Back to top

When importing products, fields that contain commas can cause issues, as commas are treated as field separators. To prevent this, be sure to escape your needed commas to ensure they are correctly imported.

For example, this would import the categories Places, People, Cities

Places\, People\, Cities

By escaping these commas, you can ensure that the entire category name is treated as a single entity during the import process.

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 importer to add new products with one upload.

  1. Go to Products > All Products.
  2. Select Import at the top of the page. The Upload CSV file screen displays.
  1. Select Choose File and choose the CSV file you want to import.
  2. Click Continue.
  3. Review the Column Mapping screen. WooCommerce automatically attempts to map recognized CSV columns to product fields.
  1. Use the dropdown menus to adjust fields or choose Do not import for any column that should be ignored.
  2. Any unrecognized columns will not be imported by default.
  3. Click Run the Importer.
  4. Wait until the import is finished. Do not refresh or navigate away from the page while the import is in progress.

Your product import is complete.

Update Existing Products

↑ Back to top

Store owners can use the CSV importer to bulk update existing products, such as adding a brand, changing a tax class, preparing a sale, or syncing product data between stores. The importer uses product IDs or SKUs in the CSV to match existing products in your store.

  1. Make a CSV file as outlined in the Create your CSV section, using the IDs or SKUs of the products you want to update.
  2. Go to Products > All Products.
  3. Select Import at the top of the page.
  4. Select Choose File and choose your CSV file.
  5. Tick Update existing products. Existing products that match by ID or SKU will be updated. Products that do not exist will be skipped.
  6. Click Continue and review the Column Mapping screen.
  7. Use the dropdown menus to adjust fields or choose Do not import for any column that should be ignored.
  8. Click Run the Importer.
  9. Wait until the update is finished. Do not refresh or navigate away from the page while the import is in progress.

Your product update is complete.

Troubleshooting failed or skipped imports

↑ Back to top

If the import finishes but some products are missing or skipped, check the import log first. Common causes include:

  • A product already exists with the same SKU or ID, and Update Existing Products was not selected.
  • The CSV uses columns or values that do not match the Product CSV Import Schema.
  • The Published column marks products as draft, private, or unpublished in a way you did not expect. See the Published row in the schema below for supported values.
  • A plugin or theme conflict is interrupting the import.
  • The CSV is too large for the server to process in one request. Split large CSV files into smaller batches and import each batch separately.

Troubleshooting upload errors

↑ Back to top

If you see the error Sorry, this file type is not permitted for security reasons., WordPress may have misdetected the file type. This can happen on some servers when a CSV contains HTML.

First, confirm that the file is saved as a CSV. If the upload still fails, upload the CSV file to your site’s uploads directory using FTP or your host’s file manager. Then open Advanced Options in the importer and enter the server file path.

As a temporary last resort, you can add define( 'ALLOW_UNFILTERED_UPLOADS', true ); to your wp-config.php file for the import. Remove that line immediately after the import finishes.

Importing large product catalogs

↑ Back to top

Large imports depend on your server’s available memory, upload limits, and processing time. Before importing a large catalog, make a backup or use a staging site, test a small sample import, and split the CSV into smaller batches so issues are easier to find and fix.

The Maximum size value shown on the upload screen is set at the server level. To increase it, contact your hosting company.

For extensive imports or custom product data from extensions, consider Product CSV Import Suite.

Converting existing Simple Product to Variable Product

↑ Back to top

You can use the CSV importer to convert an existing simple product into a variable product. This process uses two imports: one to update the existing product into a variable product with attributes, and another to add the variation rows as new products.

Before you start, create a backup or test on a staging site. Then create a simple product that has a SKU and price, and export that product from Products > All Products.

  1. Open the exported CSV file in a CSV editor.
  2. Keep the existing product row in place, and add one new row for each variation.
  3. In the parent product row, change the Type value from simple to variable.
  4. In each variation row, set the Type value to variation.
  5. Give each variation row its own unique SKU and Name.
  6. Add the attribute columns needed for the variable product. For one local attribute named Size, add Attribute 1 name, Attribute 1 value(s), Attribute 1 visible, and Attribute 1 global.
  7. In the parent product row, list all available values in Attribute 1 value(s), such as S, M. In each variation row, enter only the value for that variation, such as S or M.
  8. Set Attribute 1 visible to 1. Set Attribute 1 global to 0 for a local product attribute, or 1 if the attribute is a global attribute already configured in your store.
  9. In each variation row, set the Parent value to the parent product SKU or ID.
RowTypeSKUParentAttribute 1 nameAttribute 1 value(s)Attribute 1 visibleAttribute 1 global
Parent productvariabletshirtSizeS, M10
Variationvariationtshirt-stshirtSizeS10
Variationvariationtshirt-mtshirtSizeM10

After editing the CSV, save it as a new CSV file. Then run two imports:

  1. First import the CSV with Update existing products selected. This updates the existing product into a variable product and adds the attribute data. Variation rows that do not already exist are skipped during this update import.
  2. Open the CSV again, remove the parent product row, and leave the variation rows in place.
  3. Import the variation-only CSV with Update existing products unselected. This creates the variations and attaches them to the parent product.
  4. After the import is complete, open the product and confirm that it is now a variable product with the expected variations.

If the variations are not created, check that each variation has a unique SKU, that the Parent value matches the parent product SKU or ID, and that the attribute columns match the values used by the parent product.

Export

↑ Back to top

Store owners can export the current product catalog to a CSV file using the built-in product importer/exporter tool.

  1. Go to Products > All Products.
  2. Select Export at the top of the page. The Export Products screen displays.
  1. Choose which columns should be exported, or leave the default Export all columns option selected.
  2. Choose which product types and product categories should be exported, or leave the defaults selected to export all products and categories.
  3. Tick Yes, export all custom meta if you need product metadata from WooCommerce or other plugins. Metadata columns are exported with a meta: prefix. For example, metadata under the product_depth key exports as meta:product_depth.
  4. Click Generate CSV and wait for the export to finish.

Your browser will download the exported CSV file.

Variation names in exports

↑ Back to top

WooCommerce may exclude attribute values from variation names in exported CSV files. This is expected when a product has three or more attributes, or when it has two or more attributes and at least one attribute name contains two or more words.

Developers can force variation titles to include attributes with the woocommerce_product_variation_title_include_attributes filter:

add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_true' );

Selective Product Export

↑ Back to top

In WooCommerce 9.9 and newer, you can export selected products from the product list screen.

  1. Go to Products > All Products.
  2. Select the products you want to export.
  3. Click Export X selected at the top of the page. The button label updates to show the number of selected products.

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. Current versions of WooCommerce also accept true/false values.
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

Custom columns and metadata

↑ Back to top

The built-in importer maps known schema columns and product metadata columns. Any unrecognized columns are not imported by default.

To import custom product metadata, prefix the CSV header with meta:. For example, use meta:product_depth for a custom field stored with the key product_depth. If WooCommerce does not map the column automatically, map it to Import as meta on the Column Mapping screen.

Adding entirely new importer fields requires custom code. Customizations are developer-level work and are not covered under the WooCommerce Support Policy.

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.