The Import WP WooCommerce add-on includes a dedicated WooCommerce Orders template. It creates real WooCommerce orders (shop_order) with status, customer, billing/shipping addresses, line items, and totals — not generic posts.
Import products and customers first so line items can resolve SKUs and orders can attach to accounts. See Import WooCommerce Customers and Import WooCommerce Products.
Requirements
- WordPress with WooCommerce installed and activated
- Import WP (free)
- Import WP WooCommerce add-on (free) — orders and customers
Create a WooCommerce Orders importer
- Go to Import WP → Add Importer.
- Choose your file source.
- On the template step, select WooCommerce Orders.
There is no post-type dropdown — the template is fixed to WooCommerce orders.
Template sections
| Section | What it imports |
|---|---|
| Order Fields | Order ID (match only), order key, status, currency, date created, customer note, payment method, payment method title, transaction ID |
| Customer | Existing customer by ID, email, or username |
| Billing Address | First name, last name, company, address 1/2, city, postcode, country, state, email, phone |
| Shipping Address | First name, last name, company, address 1/2, city, postcode, country, state, phone |
| Line Items | Repeatable rows: product (SKU or ID), quantity, optional line total, optional name |
| Order Totals | Shipping total, discount total, cart tax, order total |
| Custom Fields | Extra order meta (Import WP Pro) |
Status values are WooCommerce statuses without the wc- prefix (pending, processing, completed, on-hold, cancelled, refunded, failed). Default for a new order is pending if status is not mapped. Currency defaults to the store currency.
Unique identifiers
WooCommerce assigns order IDs. Order ID cannot be inserted — it is only a reference to match an existing order on update.
| Identifier | When to use |
|---|---|
Order Key (_order_key) |
Preferred. Map a stable key from the old platform (or WooCommerce _order_key on a re-import). |
Order ID (ID) |
Update an order that already exists in this store. Enable the Order ID field and select it on Permissions. |
If neither identifier has a value, the row fails with No unique identifier value present.
On a first migration, generate or keep a unique order key per order in the CSV (for example the source platform’s order number prefixed, shopify_1001). Re-runs then update that order instead of creating a second one.
Minimum CSV example (one order, one line)
| Order Key | Status | Customer Email | Billing First | Billing Last | Billing Email | SKU | Qty |
|---|---|---|---|---|---|---|---|
| shopify_1001 | processing | [email protected] |
Alice | Smith | [email protected] |
simple-one | 2 |
| shopify_1002 | completed | [email protected] |
Bob | Jones | [email protected] |
simple-two | 1 |
Suggested mapping:
| CSV column | Import WP field | Section |
|---|---|---|
| Order Key | Order Key | Order Fields |
| Status | Status | Order Fields |
| Customer Email | Customer | Customer → Field Type = Email |
| Billing First / Last / Email | Billing Address fields | Billing Address |
| SKU | Product | Line Items → Product Field Type = Product SKU |
| Qty | Quantity | Line Items |
Line items: one record per order
Line items are a repeatable group on a single order row. On update, existing line items are replaced, so you cannot import one CSV row per line item that shares the same order key — the second row would wipe the first item.
CSV with several products on one order: add extra Line Items rows in the template (Add row) and map sku_1 / qty_1, sku_2 / qty_2, and so on.
XML / JSON with nested items: set the line-item row base (repeater node) to the repeating product node. Import WP loops those children onto one order. Missing SKUs are skipped (the rest of the order still saves).
| Line item field | Notes |
|---|---|
| Product | SKU (default) or Product ID |
| Quantity | Defaults to 1 |
| Total | Optional. Leave empty to use the current product price |
| Name | Optional line-item name override |
Products must already exist. Import the catalogue first. Variation line items should use the variation SKU, not the parent SKU.
Customer linking
Under Customer, map a value and set Customer Field Type:
| Type | Looks up |
|---|---|
| Email (default) | get_user_by( 'email' ) |
| Username | get_user_by( 'login' ) |
| ID | WordPress user ID |
If no user matches, the order is still created as a guest order (customer_id = 0). Billing email on the order can still be set from Billing Address → Email.
Import customers before orders when you want My Account history attached.
Order totals
| Field | Behaviour |
|---|---|
| Shipping Total | Creates a shipping line named “Shipping” and sets shipping total |
| Discount Total | Sets the order discount total |
| Cart Tax | Creates a tax line and sets cart tax |
| Order Total | If mapped, that value is stored. If left empty, WooCommerce calculates totals from line items |
Leave Order Total empty unless the feed is the system of record for the paid amount (historical migrations often map the original total so it matches the old shop).
Notification emails
Enable order notification emails is off by default. When off, Import WP suppresses WooCommerce emails such as new order, processing, completed, on-hold, cancelled, failed, refunded, invoice, and customer note.
Turn it on only when you intend customers and admins to receive status emails during the import.
Update existing orders
- Map Order Key (or enable Order ID for in-store IDs).
- Select that field as the unique identifier on Permissions.
- Enable Update.
- Re-running the file replaces line items on matched orders with the items in the file.
Do not change the order key between runs.
Filters
add_filter( 'iwp/woocommerce/order_field', function ( $value, $field ) {
// $field examples: status, currency, payment_method, billing_country
return $value;
}, 10, 2 );
add_filter( 'iwp/woocommerce/order_field/status', function ( $value ) {
return strtolower( $value );
} );
More snippets: WooCommerce Filters and Code Snippets.
Related
Updated 2026-09-16