Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@maddisondesigns
Last active October 15, 2020 08:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save maddisondesigns/8af101eb9a92ff23b1ba7ad060030828 to your computer and use it in GitHub Desktop.
Save maddisondesigns/8af101eb9a92ff23b1ba7ad060030828 to your computer and use it in GitHub Desktop.
WooCommerce Product CSV Import Schema
ID Type SKU Name Published Is featured? Visibility in catalog Short Description Description Date sale price starts Date sale price ends Tax Status Tax Class In stock? Backorders allowed? Sold individually? Weight (unit) Length (unit) Width (unit) Height (unit) Allow customer reviews? Purchase Note Price Regular Price Stock Categories Tags Shipping Class Attribute 1 Name Attribute 1 Value(s) Attribute 1 Default Attribute 1 Visible Images Download 1 Name Download 1 URL Download Limit Download Expiry Days Parent Upsells Cross-sells
id type sku name status featured catalog_visibility short_description description date_on_sale_from date_on_sale_to tax_status tax_class stock_status backorders sold_individually weight length width height reviews_allowed purchase_note price regular_price manage_stock / stock_quantity category_ids tag_ids shipping_class_id attributes attributes default_attributes attributes image_id / gallery_image_ids downloads downloads download_limit download_expiry parent_id upsell_ids cross_sell_ids
100 simple, variation, virtual my-sku My Product Name 1 1 visible This is a product. This is more information about a product. 7/6/13 10:53 7/6/13 10:53 taxable standard 1 1 1 100 20 20 20 1 Thanks for buying it buddy. 20.99 24.99 20 Category 1, Category 1 > Category 2 Tax 1, Tag 2 Name Color Blue, Red, Green Blue 1 http://somewhere.com/image.jpg, http://somewhere.com/image2.jpg Download 1 url.zip 1 1 id:100, SKU-1 id:100, id:101, SKU-1, SKU-2 id:100, id:101, SKU-1, SKU-2
Defining this will overwrite data for that ID on import. Product Type. Valid values: simple, variable, grouped, external, variation, virtual, downloadable. Multiple types can be used CSV separated. Required. Auto-generated if missing. Required. 1 for published, 0 for draft. 1 or 0 Supported values: visible, catalog, search, hidden Date or leave blank. Date or leave blank. Supported values: taxable, shipping, none Can use any existing tax class. 1 or 0 1, 0, or notify 1 or 0 Parse only numbers. Parse only numbers. Parse only numbers. Parse only numbers. 1 or 0 May set sale or regular price depending on other columns. Non-sale price. Numeric stock level enables stock management. parent can be used for variations. Blank = no stock management. CSV list of categories. > used for hierarchy. CSV list of tags. Name of shipping class Looks for global attribute or uses text if not found. Include as many as needed. "Used for variations" is set automatically. List of values. Variations only need 1 value. First is used if multiple get provided. Default value for variable products. 1 or 0 First is featured image. n/a or a limit. n/a or a day limit. Set parent ID. Used for simple products in a group and variations. Can be just a numeric ID e.g. id:100 or a SKU. Export will use SKU when possible. List of IDs. Can be just a numeric ID e.g. id:100 or a SKU. Export will use SKU when possible. List of IDs. Can be just a numeric ID e.g. id:100 or a SKU. Export will use SKU when possible.
@maddisondesigns
Copy link
Author

maddisondesigns commented Sep 20, 2017

This is the schema used for the built in CSV importer and exporter in WooCommerce 3.1+.

Visit the Product CSV Importer and Exporter guide for more information on how to use it.

General CSV guidelines

  • CSVs should be in UTF-8 format.
  • Any dates should be defined for the store's local timezone.
  • If importing a boolean value (true or false) use 1 or 0 in your CSV.
  • Multiple values in a field get separated with commas.
  • If referencing an existing Product ID, prefix the id with id:. If referencing a SKU, no prefix is needed. e.g. id:100, SKU101
  • Custom meta is supported/imported but only plain text - no support for JSON or Serialised data.
  • Taxonomy term hierarchy is denoted with > and terms are separated with commas. e.g. Category 1, Category 1 > Category 2
  • Serialised data is not supported.
  • Images need to be pre-uploaded or available online in order to import to your store.
  • External URLs are supported and imported into the media library if used.
  • You can define the filename if the image already exists in the media library.

See the official Product CSV Import Schema page on the WoooCommerce Wiki for more information.

Download sample CSV-Product-Import.xlsx Excel file. This sample file also includes sample data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment