Want to know how to export WooCommerce orders and products? 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’ll be a true export master. You’ll also have a handy reference in case you run into problems exporting WooCommerce orders and products in the future.
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
Download and Install the Plugins
Start a New WooCommerce Order Export
Select Your Order Export Fields
Download the Order Export File
Export WooCommerce Orders — Advanced Topics
Export Orders to a Different File Type
Apply Powerful Filters to Your WooCommerce Order Export
Create Custom Columns Using PHP
Export WooCommerce Orders — Frequently Asked Questions
How to Export WooCommerce Products
Finding the Right Product Export Plugin
Step-by-Step Instructions to Export WooCommerce Products — The Basics
Download and Install the Plugins
Start a New WooCommerce Product Export
Choose Your Product Export Fields
Download the Product Export File
Export WooCommerce Products — Advanced Topics
Export Products to a Different File Type
Apply Powerful Filters to Your WooCommerce Product Export
Export Your Products to the Google Merchant Center
Export WooCommerce Products — Frequently Asked Questions
Despite its extensive functionality, WooCommerce does not have the ability to export sales orders on its own. For this, you require a third-party 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:
The one plugin that doesn't have these limitations is WP All Export. It can handle every aspect of exporting WooCommerce orders no matter how complex.
Even better, the same plugin can handle all your other export needs regardless of whether they involve WooCommerce, another plugin, or any part of WordPress. The same is true on the import side with WP All Import.
Download and install the base WP All Export plugin and its WooCommerce Export Order add-on.
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:
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:
To remove a field, simply drag and drop it outside the column selection area.
WP All Export lets you select fields from all of these categories:
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:
The bundle file contains both a CSV file and an import template that helps WP All Import automatically process the CSV file. This makes migrating orders from one site to another quick and easy.
And that’s it! A basic WooCommerce order export couldn’t be any simpler!
Some of the instructions in this section require the Pro version of the plugins, which you can read about at Export WooCommerce Orders to XML & CSV. In case you do not have this version, we have provided visuals that allow you to read the following examples without performing them.
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:
Prefer XML? Not a problem:
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 complex/sophisticated as you require.
Applying filters to your WooCommerce order export is easy. You can do this in the Add Filtering Options section of the New Export screen:
This filter means, “Export WooCommerce orders with an order date equal to or newer than January 01, 2018.”
You can also combine filters:
And create nested filters:
In the Drag & Drop interface, if you click the Add Field button…
…you can create custom 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”:
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:
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:
Yes. WP All Export automatically detects all custom fields created by any theme, plugin, or WooCommerce extension.
No. WP All Export lets you control every aspect and detail of XML output.
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 settings data in addition to the 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.
Unlike with its sales orders, WooCommerce does have the built-in ability to export product data. However, these capabilities are extremely limited and only suitable for quick, ad hoc exports. If you want anything more than this, you will again have to turn to 3rd-party plugins.
The same arguments in favor of WP All Export apply here, too. In fact, with its unique ability to generate a fully compliant product feed for the Google Merchant Center, WP All Export offers even more advantages for exporting WooCommerce products than it does for exporting orders.
Download and install the base WP All Export plugin and its WooCommerce Export Product add-on.
Go to All Export > New Export and select WooCommerce Products as the export type. Then click the Customize Export File button:
When exporting WooCommerce products, most users only require a subset of the available fields. WP All Export meets this need by providing a simple Drag & Drop interface.
The available product tables and fields are displayed in the Available Data section on the right. To export a field, drag it into the column selection area:
To remove a field, simply drag and drop it outside the column selection area.
WP All Export lets you select fields from all of these categories:
Once you’ve completed setting up your product 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:
The bundle file contains both a CSV file and an import template that helps WP All Import automatically process the CSV file. This is extremely helpful if you’re trying to migrate products from one site to another.
And that’s it. That’s how you perform a basic WooCommerce product export!
Some of the instructions in this section require the Pro version of the plugins, which you can read about at Export WooCommerce Products. In case you do not have this version, we have provided visuals that allow you to read the following examples without performing them.
The preceding example exported products to a CSV file, but you can quickly change this to Excel simply by changing the export type in the Drag & Drop interface:
Prefer XML?
Note, you can export WooCommerce products to a Simple XML Feed or a Custom XML Feed. If you choose a custom feed, you can make this feed as complex/sophisticated as you require.
Applying filters to your WooCommerce product exports is easy. You can do this in the Add Filtering Options section of the New Export screen:
In this case, we are saying, “Export WooCommerce products with a product category of ‘classic’.”
You can also combine filters:
You can even write your WooCommerce product export filters using PHP:
function exclude_drafts_from_gmc_export($articles, $options, $export_id) {
// Only filter GMC exports.
if ($options["xml_template_type"] == "XmlGoogleMerchants") {
// Process every exported product.
foreach ($articles as $key => $article) {
// If IDs aren't set to be exported, do nothing.
if ( ! empty($article['id']) ) {
$post_id = $article['id'];
$parent_id = wp_get_post_parent_id($post_id);
// Check the parent's Status.
if ( get_post_status($parent_id) == "draft" ) {
// Don't export variation if parent is 'draft'.
unset($articles[$key]);
}
}
}
}
return $articles;
}
add_filter('wp_all_export_csv_rows', 'exclude_drafts_from_gmc_export', 10, 3);
To export WooCommerce Products to the Google Merchant Center, just change your product export type to Google Merchant Center Product Feed, as shown below:
WP Export will respond by presenting the Google Merchant Center options divided into various sections:
You can modify the settings for each of these sections. For example, here are the typical settings for the Basic Product Information panel.
And here’s a typical setup for the Availability & Price panel:
For complete instructions on exporting WooCommerce products to the Google Merchant Center, please see our article, How to Export WooCommerce Products to the Google Merchant Center.
The important point here is that, in addition to guiding you through this special export process, WP All Export will create an export file that is automatically set up for submission to the Google Merchant Center. And what happens if submission requirements change? No problem. WP All Export will change right along with them.
In addition to all this functionality for exporting WooCommerce products, this plugin also allows you to:
Yes. WP All Export automatically detects all custom fields created by any theme, plugin, or WooCommerce extension.
No. WP All Export lets you control every aspect and detail of the XML output.
Export the products that you wish to migrate. When you do this, download the Bundle option instead of a CSV file. The bundle file contains settings data in addition to the 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.
Want more information on how to export WooCommerce orders and products? See these key articles:
How to Export WooCommerce Orders to CSV, Excel, or XML
How to Export WooCommerce Products
How to Export WooCommerce Products to Google Merchant Center