Now is your last chance to buy a lifetime license before we switch to annual pricing. Existing licenses will be unaffected.
read more
Posted on November 11, 2022

How to Import and Export WooCommerce Orders

hello world!

Want to know how to import and export WooCommerce orders? In this article, we’ll start by teaching you the basics. Then we’ll dive deep into the most challenging problems you’ll encounter when performing these tasks. By the end, you should be able to handle pretty much any WooCommerce order import or export. Here is what is contained in this article:

How to Export WooCommerce Orders

Finding the Right Order Export Plugin

Step-by-Step Instructions to Export WooCommerce Orders — The Basics

Export WooCommerce Orders — Advanced Topics

Export WooCommerce Orders — Frequently Asked Questions

How to Import WooCommerce Orders

Finding the Right Order Import Plugin

Step-by-Step Instructions to Import WooCommerce Orders — The Basics

Import WooCommerce Orders — Advanced Topics

Import WooCommerce Orders — Frequently Asked Questions

Related Information

Related Videos

How to Export WooCommerce Orders

Export WooCommerce Orders

Despite its extensive functionality, WooCommerce does not have the ability to export orders on its own. For this, you require a third-party plugin.

Finding the Right WooCommerce Order Export Plugin

If you search the internet, you will find several plugins capable of exporting WooCommerce orders. Unfortunately, most of them suffer from the same two limitations:

  1. They aren't designed to handle complex order exports, which are often required when trying to integrate with external systems. Instead, you must create custom code for these situations, which is always the least desirable solution.
  2. They're generally limited to importing and exporting orders or, at best, handling only WooCommerce data. This means that if you put in the effort to master such a plugin and then need to import or export other WordPress data, you'll have to switch to another plugin.

The one plugin that doesn't have these limitations is WP All Export. It can handle every aspect of exporting WooCommerce and WordPress data, no matter how complex. The same is true on the import side with WP All Import. WP All Export WooCommerce Orders

 

Step-by-Step Instructions to Export WooCommerce Orders — The Basics

 

Export WooCommerce Orders Step 1: Download and Install the Plugins

Download and install the base WP All Export plugin and its WooCommerce Export Order add-on. If you don't have access to these plugins, you can use this free online sandbox. Just choose the WooCommerce Store option and click Create Sandbox.

Export WooCommerce Orders Step 2: Start a New Order Export

Navigate to All Export > New Export in the WordPress main menu. Select WooCommerce Orders as the export type. Then click the blue Customize Export File button at the bottom:

Create WooCommerce Order Export

Export WooCommerce Orders Step 3: Select Your Order Export Fields

When exporting WooCommerce orders, most users do not require all the order data fields. WP All Export provides a simple Drag & Drop interface to let you select a subset of these fields. The available order tables and fields are displayed in the Available Data section on the right. To export a field, drag it into the column selection area. For example, here, we have expanded the Order panel on the right and dragged the Order Status field into the column selection area:

Here, we have expanded the Customer panel on the right and dragged the Billing Last Name and Billing First Name fields into the column selection area:

WooCommerce Order Export Drag and Drop Customer Fields

To remove a field, simply drag it from the column selection area and drop it elsewhere.

WP All Export lets you select fields from all of these order-related categories:

  • WooCommerce Order Data
  • WooCommerce Customer Data
  • WooCommerce Order Items
  • Order Taxes & Shipping
  • Order Fees & Discounts
  • Order Notes
  • Order Refunds
  • WooCommerce Order Custom Fields
  • All other WooCommerce order fields

Export WooCommerce Orders Step 4: Download the Order Export File

Once you’ve completed setting up your order export, click Continue, then verify the export settings. To run the export, click Confirm & Run Export. You can then click either the CSV or Bundle button in the Click to Download section:

Confirm and Run Order Export

The bundle file contains both a CSV file and a template that helps WP All Import automatically import the CSV file. This makes migrating orders from one site to another quick and easy.

That’s it! A basic WooCommerce order export couldn’t be any easier!

Export WooCommerce Orders — Advanced Topics

Some of the instructions in this section require the Pro version of the plugins, which you can read about in Export WooCommerce Orders to XML & CSV. Our online sandbox uses these versions.

In case you do not have these versions and you're not using our online sandbox, we have provided sufficient visuals to allow you to read the following examples without performing them.

Export Orders to a Different File Type

The preceding example exported orders to a CSV file, but you can quickly change this to Excel simply by changing the export type in the Drag & Drop interface:

WooCommerce Order Export to Excel

Prefer XML? Not a problem:

WooCommerce Order Export to XML

Note, you can export WooCommerce orders to a Simple XML Feed or a Custom XML Feed. If you choose a custom feed, you can make this feed as sophisticated as you require.

Apply Powerful Filters to Your WooCommerce Order Export

Applying filters to your WooCommerce order export is easy. You can do this in the Add Filtering Options section of the New Export screen:

Export WooCommerce Orders Simple Filter

This filter means, “Export WooCommerce orders with an order date equal to or newer than January 01, 2018.” You can also combine filters:

Export WooCommerce Orders Combination Filter

And create nested filters, which is the same as grouping filter conditions using parentheses. No other plugin offers this level of filter capabilities.

Nested Filter

Create Custom Order Export Columns Using PHP

In the Drag & Drop interface, if you click the Add Field button:

Export WooCommerce Orders Add Field

This allows you to create custom order export columns. In the following example, we’ve used drag & drop to combine the Billing First Name and Billing Last Name fields into a custom column called “Name”:

Custom Field

That’s a simple custom field. To create a more complex field, you can use the Function Editor (shown above) to define your field using PHP:

function output_shipping($weight){

   if($weight <= 10) {
     return "USPS";
   } else if ($weight > 10 && $weight < 30) {
     return "DHL";
   } else if ($weight >= 30) {
     return "Knight-Swift Freight";
   }

}

Then just refer to the function in the Custom export field box, like this:

Function Editor

It is a testament to WP All Export that we have barely even scratched the surface of its WooCommerce order export capabilities. Other advanced features include the ability to:

  • Use WP_Query to create queries that can’t be created any other way, at least not efficiently
  • Use WPML to export your orders in different languages
  • Automatically schedule your WooComerce order exports
  • Split large order exports into different batches and files
  • Integrate with Zapier to send WooCommerce order exports to 1,000s of external apps

Export WooCommerce Orders — Frequently Asked Questions

 

Can I Export WooCommerce Order Fields Added by a Plugin? What About WooCommerce Extensions?

Yes. WP All Export automatically detects all custom fields created by any theme, plugin, or WooCommerce extension. You can export these fields just as easily as regular fields.

Are There Any XML Order Export Requirements That Are Too Complicated for These Plugins to Handle?

No. WP All Export lets you control every aspect and detail of XML output.

How to Export All WooCommerce Orders?

If you just run a standard order export without applying any filters, you will export all WooCommerce orders by default. If you have a large number of orders, you can avoid overwhelming your server's resource limits by splitting your export into multiple files in the Export Settings screen.

How to Migrate WooCommerce Orders to Another Website?

Export the orders that you wish to migrate. When you do this, download the "Bundle" option instead of a CSV file. The bundle file contains import settings data in addition to the order export data. Upload the bundle file on the other site. WP All Import will automatically know how to process the bundle file based on its settings.

How to Import WooCommerce Orders

Import WooCommerce Orders

As with exporting orders, WooCommerce does not have the built-in capacity to import orders. Your only choice is to use a third-party plugin.

Finding the Right WooCommerce Order Import Plugin

Most of the plugins available to import WooCommerce orders suffer the same two limitations as those available for exporting orders: if you're attempting anything other than a simple import, you will quickly run into limitations. And if you want to import data other than WooCommerce orders, especially if you ever want to import WordPress data, you'll find yourself shopping for an additional plugin. Our suggestion is: don't bother. WP All Import will let you import every kind of WordPress and WooCommerce data without any limitations.

WP All Import Feature Image 2

The other advantage of this plugin is that every import and export follows the same basic model and procedures, whether you're importing WooCommerce orders, customers, products, etc., or WordPress posts, pages, taxonomies, etc. You just have to pay for one plugin and learn one basic way of doing things, then you can forever put aside the question of how you import and export data.

Step-by-Step Instructions to Import WooCommerce Orders — The Basics

 

Import WooCommerce Orders Step 1: Download and Install the Plugins

To perform an order import, you need the base WP All Import plugin and the WooCommerce Import Add-On Pro plugin. If you don't have access to these plugins, you can use this free online sandbox. Just choose the WooCommerce Store option and click Create Sandbox.

Import WooCommerce Orders Step 2: Start a New Order Import

Go to All Import > New Import in the WordPress main menu.

New WooCommerce Order Import

  1. Choose the Upload a file option.
  2. Upload the import file. If you don't have a WooCommerce order file to import, upload the file generated by our instructions in Step-by-Step Instructions to Export WooCommerce Orders.
  3. Select New Items.
  4. Choose WooCommerce Orders as your import target.
  5. Click Continue to Step 2.

Import WooCommerce Orders Step 3: Review the Import File

Review WooCommerce Order Import File

This screen allows you to check whether the order import file has been correctly parsed. If not, go back to Step 1, fix the problem with your file, then try again.

Usually, the file is parsed without a problem. If so, just click the Continue to Step 3 button. Note, you can also add order import filters here by expanding the Add Filtering Options panel, but we cover this topic in the Import WooCommerce Orders — Advanced Topics section.

Import WooCommerce Orders Step 4: Map the Incoming Data Elements to Their Target Fields

The Drag & Drop interface will now appear. This is where you map the incoming data elements to the WooCommerce order fields. To do this, just drag the data elements from the panel on the right to the target fields on the left. In this case, we're trying to populate the Order Status field in the Order Details section:

WooCommerce Import Order Drag and Drop Order Status

  1. Choose Set With XPath.
  2. Drag and drop the incoming orderstatus data element to the field edit box.

Next, expand the Billing & Shipping Details section and drag and drop the incoming billinglastname and billingfirstname data elements to their target fields.

WooCommerce Import Order Drag and Drop Billing Names

As you can see from the preceding images, there are many sections and many fields that can and should be populated in an order import. The main sections are:

  • Order Details
  • Billing & Shipping Details
  • Order Items
  • Notes

Others might appear depending on the plugins or WooCommerce extensions installed on your site.

We're not going to describe all sections and their fields because it will take too long. Instead, you can read about them WP All Import's documentation article, How to Import WooCommerce Orders.

For now, just click the blue Continue to Step 4 button shown at the bottom of the screen (our Step 5).

Import WooCommerce Orders Step 5: Configure the Import Settings

The Import Settings screen will now appear. Here, your most important task is to select the unique identifier for the incoming orders. This helps WP All Import differentiate between orders.

The easiest way to select this value is just to click the green Auto-detect button, as shown here:

WooCommerce Order Import Settings

You can enter this value manually if you wish, but the auto-detect feature usually does a great job of selecting the best identifier.

As you can see from this screenshot, there are many other settings on this screen, including separate sections for scheduling and advanced settings. We'll describe some of these in the Import WooCommerce Orders — Advanced Topics section.

For now, just click the blue Continue button at the bottom.

Import WooCommerce Orders Step 6: Run the Import

The next screen in the process is the Confirm & Run screen:

WooCommerce Order Import Confirm and Run

This screen provides a convenient Import Summary section that allows you to review what will happen during the order import prior to proceeding with it. If you spot a mistake, you can go back to the previous steps (not shown) and correct whatever is wrong.

If everything is okay, click the Confirm & Run Import button.

When the import finishes, this screen will appear:

WooCommerce Order Import Complete

If you look closely at this screen, you will see that the orders that you attempted to import have all been skipped. This is because the import file lacked information on the customers and products associated with the orders. Again, we did not include this data because it would have taken too long. Instead, we wanted you to experience the basic loop of exporting and importing WooCommerce orders. Mapping additional fields will not change the nature of this process.

If you would like to experience a complete order import, please see our documentation page, How to Import WooCommerce Orders.

Import WooCommerce Orders — Advanced Topics

How to Handle Missing Product and Customer Information

In the preceding section, all the imported orders lacked product information. By default, WP All Import tries to match the incoming product SKUs to the SKUs of existing products in the WooCommerce store. In our tutorial, there were no incoming product SKUs, so every order import failed. A much more common scenario is that some of the import orders will have SKUs that do not match your existing products.

One obvious solution to this problem is to edit the import file to correct the erroneous SKUs.

However, there is an alternative. If the product information is present in the import file but lacks the correct SKUs, you can opt to manually import the product data in the Order Items section of the Drag & Drop screen, as shown here:

WooCommerce Import Order Items Data

In this scenario, you simply drag and drop the relevant fields from the import file into the fields shown above.

A similar situation exists for missing customer data, which can be handled in the Billings & Shipping Details section of the Drag & Drop screen:

WooCommerce Order Import Billing & Shipping Details

As the text on the screen suggests, the plugin normally attempts to match incoming customers to existing customers using an email address or some other unique value. But if such a match isn't possible, you can instruct the plugin to create the required customer information on the fly.

WP All Import is full of these types of options to handle pretty much any import or export situation. That's why it is the industry leader.

Importing WooCommerce Orders From a Different File Type

As with exporting WooCommerce orders, you can import orders from many different file types, including CSV, Excel, and XML. To do this, just upload the file as shown earlier in this tutorial, then the plugin will a) automatically recognize the file type and b) adjust its interfaces accordingly.

For example, if you upload an XML file instead of a CSV file, the information in the Review Import File will display the XML elements:

WooCommerce Order Import Review XML Import File

Filtering Incoming Orders

The basics of creating filters for WooCommerce order imports are similar to those described in the Apply Powerful Filters to Your WooCommerce Order Export section. The main differences are:

  1. The import filter tool is accessed in the Review Import File screen instead of the New Import screen.
  2. The import data is outside the WordPress database, so filters have to be applied using the XPath language.

To support this, filter rules are placed in a temporary area as you create them, as shown here:

WooCommerce Order Import Filters

When you are ready to apply these rules, click the Apply Filters to XPath button. This will populate the XPath field in the upper section with the equivalent XPath code, as well as apply the filters to the data.

WooCommerce Order Import Filter XPath

For most people, this is merely a slight procedural difference compared to export filters. But for advanced users, it is an opportunity to exert unparalleled control. The XPath field is editable, and XPath is a very powerful language, so there are virtually no limits when it comes to building order import filters.

Scheduling WooCommerce Order Imports

Many order imports occur on a regular cycle. For example, when feeding orders into your main WooCommerce system from a peripheral sales platform. In these scenarios, it is typical to configure your order import to run automatically on a schedule.

To do this, you must first set up your import to download its data from a URL or an existing file on your server. Here, for example, is how you configure an import from a URL:

WooCommerce Order Import From URL

  1. Choose Download a File.
  2. Select From URL.
  3. Paste the URL.
  4. Click the Download button.

The reason for this requirement is that scheduled imports must be able to automatically access the import data without user assistance. Obviously, forcing the user to upload a file during the import process violates this principle.

To create an import schedule, you have two options:

  1. Manually schedule your import using cron jobs on the server.
  2. Use WP All Import's Automatic Scheduling service, which allows you to schedule the import via the plugin's interface. Note, this option requires the Pro version of the plugin.

The following image depicts the plugin's scheduling interface, which is found in the Scheduling Options section of the Import Settings screen:

WooCommerce Order Import Automatic Scheduling

To use this interface, do the following:

  1. Expand the Scheduling Options panel.
  2. Choose Automatic Scheduling.
  3. Select the Every week on... option.
  4. Select the day of the week that you want the import to run, in this case, Wednesday.
  5. Schedule the time when you want the import to run.
  6. Choose a time zone.
  7. Make sure you subscribe to the Automatic Scheduling service, which is required for this scheduling option.

That's it — your order import will now run on a schedule!

One other caveat when setting up a scheduled import: you must make certain that the new order import file is in place each week before your import starts.

Import WooCommerce Orders — Frequently Asked Questions

Is There a Specific Sequence I Should Use to Import WooCommerce Data?

Yes, you should import WooCommerce data in the following order:

  1. WooCommerce Products
  2. WooCommerce Customers
  3. WooCommerce Orders
  4. WooCommerce Reviews

This will help reduce the instances in which customers and products in the order import data are missing from the WooCommerce store.

Can I Import Order Data Into Third-Party Plugins or Extensions?

Absolutely. As long as the plugin or extension in question is installed and activated, you can import data into its fields just as easily as you import data into core WooCommerce or WordPress fields.

What Table is Used to Store WooCommerce Orders?

WooCommerce orders are stored as a custom post type in the wp_posts table. The order metadata is in wp_postmeta. However, WooCommerce also uses its own custom database tables for some item data, such as wp_woocommerce_order_items and wp_woocommerce_order_itemmeta.

Want more information on how to import and export WooCommerce orders? See these key articles:

WooCommerce Order Export - Plugin Description

WooCommerce Order Import - Plugin Description

Bulk Edit WooCommerce Orders - Plugin Description

Migrate WooCommerce Orders - Plugin Description

Official Documentation: How to Export WooCommerce Orders to CSV, Excel, or XML

Official Documentation: How to Import WooCommerce Orders

Official Documentation: How to Migrate WooCommerce Orders

How to Export WooCommerce Data to CSV, Excel, or XML

How to Import WooCommerce Data from CSV, Excel, and XML

How to Import and Export WooCommerce Customers

How to Export and Import WooCommerce Products

How to Export and Import Variable Products in WooCommerce

Best WooCommerce Bulk Edit Plugins

How to Import and Export WordPress Users

How to Export and Import WordPress Categories and Tags

How to Import and Export Advanced Custom Fields

How to Export and Import Gravity Forms Entries

Leave a Reply

Your email address will not be published. Required fields are marked *

Get Oxygen Today

Lifetime, unlimited site license

Copyright © 2024 Soflyy
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram