Skip to content

Order export

The order export module lets you generate CSV files with WooCommerce order data. It supports over 30 configurable fields, date range filters and order status filters. The field selection configuration is saved in WordPress options.

Go to WooCommerce > Polski > Tools and enable Order export (module ID: order_export).

The export panel is available in WooCommerce > Polski > Tools > Order export (admin.php?page=polski-order-export).

Select the period from which you want to export orders:

  • Date from - start of the range (date picker field)
  • Date to - end of the range (date picker field)
  • Predefined ranges: Today, Last 7 days, Last 30 days, Current month, Previous month, Current year

The dates refer to the order creation date (date_created).

Select the order statuses to export (multiple selection):

  • Pending payment (pending)
  • Processing (processing)
  • On hold (on-hold)
  • Completed (completed)
  • Cancelled (cancelled)
  • Refunded (refunded)
  • Failed (failed)

By default, Processing and Completed are selected.

Select the fields to include in the CSV file. The field configuration is saved in WordPress options and remembered between exports.

FieldCSV columnDescription
Order IDorder_idOrder number
Order dateorder_dateCreation date and time
Statusorder_statusOrder status
CurrencycurrencyCurrency code (e.g. PLN)
Payment methodpayment_methodPayment method name
Payment method titlepayment_method_titleDisplayed payment name
Order totalorder_totalTotal amount
Products subtotalorder_subtotalProducts amount (excl. shipping)
Tax amountorder_taxTotal tax amount
Shipping costshipping_totalShipping cost
Shipping methodshipping_methodShipping method name
Discountdiscount_totalTotal discount amount
Coupon codecoupon_codesCoupon codes used
Customer notecustomer_noteCustomer notes on the order
Customer IPcustomer_ipCustomer IP address
FieldCSV column
First name (billing)billing_first_name
Last name (billing)billing_last_name
Companybilling_company
NIPbilling_nip
Address line 1billing_address_1
Address line 2billing_address_2
Citybilling_city
Postcodebilling_postcode
Statebilling_state
Countrybilling_country
Emailbilling_email
Phonebilling_phone
FieldCSV column
First name (shipping)shipping_first_name
Last name (shipping)shipping_last_name
Company (shipping)shipping_company
Address line 1shipping_address_1
Address line 2shipping_address_2
Cityshipping_city
Postcodeshipping_postcode
Stateshipping_state
Countryshipping_country
FieldCSV columnDescription
Product nameproduct_nameProduct name in the order
SKUproduct_skuProduct SKU code
Quantityproduct_qtyQuantity ordered
Unit priceproduct_pricePrice per item
Line totalline_totalTotal amount for the line item

When an order contains multiple products, each product is exported as a separate row with the order data repeated.

  • Encoding: UTF-8 with BOM (for correct display of Polish characters in Excel)
  • Separator: semicolon (;) - the standard for Polish Excel
  • Text qualifier: double quote (")
  • Line endings: \r\n (Windows)

After configuring the filters and fields, click Export to CSV. The file will be downloaded by the browser.

For large data sets (over 10,000 orders), the export runs in the background with a progress bar. Once finished, the file is available for download for 24 hours.

Export orders from the command line:

Okno terminala
wp polski export orders --date-from=2025-01-01 --date-to=2025-12-31 --status=completed --output=/tmp/orders.csv

Parameters:

  • --date-from - start date (YYYY-MM-DD)
  • --date-to - end date (YYYY-MM-DD)
  • --status - order status (comma separated)
  • --fields - list of fields (comma separated)
  • --output - output file path
// Add a custom field to the export
add_filter('polski/order_export/fields', function (array $fields): array {
$fields['custom_field'] = [
'label' => 'Custom field',
'callback' => function (\WC_Order $order): string {
return $order->get_meta('_custom_field');
},
];
return $fields;
});
// Modify the orders query
add_filter('polski/order_export/query_args', function (array $args): array {
$args['meta_key'] = '_billing_nip';
$args['meta_compare'] = 'EXISTS';
return $args;
});

Polish characters display incorrectly in Excel - make sure the BOM option is enabled (it is by default). In older versions of Excel, use the data import with the UTF-8 encoding setting.

The export takes too long - with a very large number of orders, use WP-CLI instead of the web interface. Consider narrowing the date range.

The NIP field is missing from the export - the billing_nip field is available only when the NIP at checkout module is active.

Reporting issues: github.com/wppoland/polski/issues

This page is for informational purposes only and does not constitute legal advice. Polski for WooCommerce is open source software (GPLv2) provided without warranty.