fervor [>]CODING & CURIOSITY
FERVOR LEARNING SYSTEMTUTORIALS
← WordPress

WordPress / 10 MIN READ

Woo Import CSV

Importing CSV into WooCommerce

From the original Fervor library. Examples may use older package versions.

Tutorial: How to Import CSV into WooCommerce

Importing CSV files into WooCommerce allows you to efficiently add or update large amounts of data such as products, orders, and customer information. Whether you’re migrating from another platform, managing a large inventory, or updating product details in bulk, this tutorial will guide you through the process of importing CSV data into WooCommerce using both built-in tools and popular plugins.

Table of Contents

  1. Prerequisites
  2. Preparing Your CSV File
  3. Importing Data Using Built-in WooCommerce Tools
  4. Importing Data Using Plugins
  5. Export Formats
  6. Tips and Best Practices
  7. Troubleshooting Common Issues
  8. Conclusion

Prerequisites

Before you begin, ensure you have the following:

  • Access to Your WordPress Dashboard: Administrative access to your WordPress site where WooCommerce is installed.
  • WooCommerce Installed and Activated: Ensure that the WooCommerce plugin is installed and activated.
  • CSV File Ready for Import: Prepare your CSV file with the correct data structure and formatting.
  • Backup Your Data: Always back up your website and database before performing import operations to prevent data loss.

Preparing Your CSV File

Properly formatting your CSV file is crucial for a successful import. Here’s how to prepare your CSV file for WooCommerce:

1. Understand the Required Fields

Depending on what you’re importing (products, orders, customers), the required fields will vary. Here’s a breakdown:

  • Products:

    • ID (optional for updates)
    • Type (e.g., simple, variable)
    • SKU
    • Name
    • Published
    • Is featured?
    • Visibility in catalog
    • Short description
    • Description
    • Tax status
    • Tax class
    • In stock?
    • Stock
    • Backorders allowed?
    • Sold individually?
    • Weight (kg)
    • Length (cm)
    • Width (cm)
    • Height (cm)
    • Allow customer reviews?
    • Purchase note
    • Sale price
    • Regular price
    • Categories
    • Tags
    • Shipping class
    • Images
    • Download limit (for downloadable products)
    • Download expiry days (for downloadable products)
    • Parent (for variations)
    • Grouped products
  • Orders:

    • Order ID (for updates)
    • Order Number
    • Order Date
    • Billing First Name
    • Billing Last Name
    • Billing Email
    • Billing Phone
    • Billing Address 1
    • Billing Address 2
    • Billing City
    • Billing State
    • Billing Postcode
    • Billing Country
    • Shipping First Name
    • Shipping Last Name
    • Shipping Address 1
    • Shipping Address 2
    • Shipping City
    • Shipping State
    • Shipping Postcode
    • Shipping Country
    • Order Status
    • Payment Method
    • Shipping Method
    • Product ID
    • Product Quantity
    • Product Total
  • Customers:

    • Customer ID (optional for updates)
    • First Name
    • Last Name
    • Email
    • Username
    • Password (for new customers)
    • Billing Address
    • Shipping Address

2. Ensure Correct Formatting

  • CSV Structure: Use a comma (,) as the delimiter. Ensure that the first row contains the column headers.
  • Encoding: Save your CSV file in UTF-8 encoding to prevent character issues.
  • Data Validation: Check for any missing or incorrect data that might cause import errors.
  • Unique Identifiers: Use unique identifiers like SKU for products and email for customers to avoid duplicates.

3. Sample CSV Templates

WooCommerce provides sample CSV templates that you can use as a reference. You can export a sample file from WooCommerce to understand the required structure.

Exporting a Sample Product CSV:

  1. Go to WooCommerce > Products.
  2. Click on the Export button.
  3. Choose Export All Columns and All Products.
  4. Click Generate CSV to download the sample file.

Importing Data Using Built-in WooCommerce Tools

WooCommerce offers built-in tools to import products and, in some cases, customers. Here’s how to use them:

Importing Products

  1. Log in to Your WordPress Dashboard: Navigate to yourwebsite.com/wp-admin and log in with your credentials.

  2. Navigate to Products: On the left sidebar, go to Products > All Products.

  3. Access the Import Tool: Click on the Import button at the top of the Products page.

    WooCommerce Import Products (Replace with actual image URL if available)

  4. Upload Your CSV File:

    • Click Choose File and select your prepared CSV file.
    • Optionally, check Update existing products if you want to update products based on SKU or ID.
  5. Map CSV Fields to WooCommerce Fields: WooCommerce will attempt to automatically map the CSV columns to the appropriate WooCommerce fields. Review these mappings to ensure accuracy. Adjust any mappings if necessary.

  6. Run the Importer: Click Run the Importer. WooCommerce will process the CSV file and import your products.

  7. Review Imported Products: After the import is complete, review your products to ensure all data has been imported correctly.

Importing Orders

As of the latest versions, WooCommerce does not provide a built-in tool for importing orders directly. To import orders, you will need to use a plugin (discussed in the next section).

Importing Customers

WooCommerce’s built-in importer does not support customer imports directly. To import customer data, you’ll need to use a plugin.

Note: Always ensure you’re using the latest version of WooCommerce, as features may be added or updated.


Importing Data Using Plugins

For more advanced import functionalities, including importing orders and customers, using a dedicated plugin is recommended. Below are two popular plugins for importing CSV data into WooCommerce:

Using WP All Import

WP All Import is a versatile and powerful plugin that allows you to import any type of data into WordPress, including WooCommerce products, orders, and customers.

1. Install and Activate WP All Import

  • Go to Plugins > Add New in your WordPress dashboard.
  • Search for “WP All Import”.
  • Click Install Now and then Activate.

2. Install the WooCommerce Add-On

To unlock WooCommerce-specific import features, install the WooCommerce Add-On:

  • Navigate to All Import > Add-Ons.
  • Find the WooCommerce Add-On and click Install.
  • Activate the add-on.

Note: The WooCommerce Add-On may require a premium license.

3. Create a New Import

  • Go to All Import > New Import.
  • Click Upload a file and select your CSV file.
  • Choose the import type, e.g., New Items or Existing Items.

4. Configure the Import Settings

  • Select Post Type: Choose Products for importing products.
  • Drag & Drop Interface: Use the drag-and-drop interface to map CSV columns to WooCommerce product fields.
  • Set Up Custom Fields: Map any custom fields or product metadata as needed.
  • Configure Import Options: Set options for updating existing products, handling images, and more.

5. Run the Import

  • Review your import settings.
  • Click Confirm & Run Import.
  • Monitor the import progress. Once completed, review your products to ensure accuracy.

WP All Import (Replace with actual image URL if available)

Advantages:

  • Highly customizable and flexible.
  • Supports importing complex data structures, including variations and custom fields.
  • Ability to schedule imports for automated updates.

Limitations:

  • Some advanced features require the premium version.
  • The learning curve may be steeper for beginners.

Using Product CSV Import Suite

The Product CSV Import Suite by WooCommerce is a premium plugin designed specifically for importing and exporting products, including complex product types.

1. Purchase, Install, and Activate the Plugin

  • Purchase the Product CSV Import Suite from the WooCommerce website.
  • Download the plugin files.
  • In your WordPress dashboard, go to Plugins > Add New > Upload Plugin.
  • Upload the plugin ZIP file, click Install Now, and then Activate.

2. Navigate to the Import Tool

  • Go to WooCommerce > CSV Import Suite.

3. Choose the Import Type

  • Select whether you want to import Products, Variations, or other data types.

4. Upload Your CSV File

  • Click Choose File and select your prepared CSV file.

5. Map CSV Fields to WooCommerce Fields

  • The plugin will automatically map CSV columns to WooCommerce fields. Review and adjust mappings as necessary.

6. Configure Import Settings

  • Set options for handling duplicates, updating existing products, and managing images.

7. Run the Import

  • Click Import to start the process.
  • Wait for the import to complete and verify the imported data.

Advantages:

  • Seamless integration with WooCommerce.
  • Supports importing complex product types, including bundled and grouped products.
  • Handles large CSV files efficiently.

Limitations:

  • It is a premium plugin, requiring purchase.
  • Limited to product-related imports.

Additional Plugins for Importing Orders and Customers

  • WooCommerce Customer/Order/Coupon Export: While primarily for exporting, some extensions allow importing as well.
  • Order Import Export for WooCommerce: A dedicated plugin for importing and exporting orders.

Choose a plugin that best fits your specific import needs and budget.


Export Formats

When importing data into WooCommerce, understanding the export formats can help ensure compatibility and ease of use:

  • CSV (Comma-Separated Values): The most commonly used format for WooCommerce imports. Ideal for spreadsheet applications like Microsoft Excel or Google Sheets.
  • XML (eXtensible Markup Language): Useful for more complex data structures and integrations with other systems.
  • JSON (JavaScript Object Notation): Often used for web applications and APIs.

Note: While CSV is the primary format supported by WooCommerce’s built-in importer and most plugins, some plugins like WP All Import also support XML and JSON.


Tips and Best Practices

  • Backup Before Importing: Always create a complete backup of your website and database before performing any import operations.
  • Use Unique Identifiers: Utilize unique identifiers such as SKU for products and email addresses for customers to prevent duplication.
  • Validate Your CSV File: Ensure your CSV file is free from errors, such as missing headers, incorrect data types, or malformed entries.
  • Test with a Small Dataset: Before importing large amounts of data, perform a test import with a small subset to ensure everything works as expected.
  • Consistent Data Formatting: Maintain consistent data formatting, especially for fields like dates, prices, and stock quantities.
  • Handle Images Properly: Ensure that image URLs are correct and accessible if you’re importing product images via URLs.
  • Map Fields Accurately: Carefully map CSV columns to WooCommerce fields during the import process to ensure data is placed correctly.
  • Monitor Server Resources: Large imports can be resource-intensive. Ensure your server has adequate resources to handle the import process.

Troubleshooting Common Issues

1. Import Fails or Stops Unexpectedly

  • Cause: Server timeout, insufficient memory, or large file size.
  • Solution:
    • Increase the PHP memory limit and maximum execution time in your server settings.
    • Split the CSV file into smaller batches and import them separately.
    • Use a plugin that supports chunked imports to manage large datasets efficiently.

2. Data Mappings Are Incorrect

  • Cause: Misaligned CSV columns and WooCommerce fields.
  • Solution:
    • Review the field mapping step carefully during the import process.
    • Ensure that CSV headers match WooCommerce field names or correctly map them manually.
    • Use a sample CSV file to understand the required structure.

3. Duplicate Entries After Import

  • Cause: Missing or incorrect unique identifiers leading to duplicate records.
  • Solution:
    • Use unique identifiers like SKU for products and email for customers.
    • Enable options like Update existing products during the import to prevent duplication.
    • Review the CSV file for any duplicate entries before importing.

4. Missing or Broken Images

  • Cause: Incorrect image URLs or inaccessible image files.
  • Solution:
    • Verify that all image URLs in the CSV are correct and publicly accessible.
    • Ensure that the images are hosted on a reliable server.
    • Use absolute URLs (including http:// or https://) in the CSV file.

5. Incorrect Product Variations

  • Cause: Improperly formatted variation data in the CSV.
  • Solution:
    • Follow WooCommerce’s guidelines for importing product variations.
    • Ensure that parent products and variations are correctly linked using unique identifiers.
    • Use plugins that specialize in handling product variations.

6. Import Plugin Issues

  • Cause: Plugin conflicts, outdated plugins, or configuration errors.
  • Solution:
    • Ensure all plugins are updated to their latest versions.
    • Disable other plugins temporarily to identify conflicts.
    • Refer to the plugin’s documentation or support for specific issues.

Conclusion

Importing CSV data into WooCommerce is a powerful way to manage and update your online store efficiently. Whether you’re adding new products, updating existing ones, importing orders, or managing customer data, understanding the import process and utilizing the right tools can save you significant time and effort.

By following this tutorial, you should be able to:

  • Prepare your CSV files correctly for WooCommerce imports.
  • Use WooCommerce’s built-in import tools for basic data imports.
  • Leverage powerful plugins like WP All Import and Product CSV Import Suite for advanced import needs.
  • Implement best practices to ensure smooth and error-free imports.
  • Troubleshoot common issues that may arise during the import process.

Remember: Always back up your data before performing imports, and consider testing with smaller datasets to ensure everything works as expected. Properly managing your imports will help maintain the integrity and accuracy of your WooCommerce store data.

Keep your curiosity going.Explore more WordPress →
287 TUTORIALS · 22 TOPICSREADY