Export WooCommerce orders for your accountant without sharing customer data

Published Updated 3 min read

Sooner or later an accountant needs the sales data. The default path is WooCommerce > Orders, select all, export to CSV, and the file that lands with your accountant has the order ID, date, total and products. It also has every customer's name, email address, billing address and phone number.

An accountant reconciling invoices against bank statements needs none of that. Under the data minimisation principle in GDPR, and similar laws elsewhere, sharing more personal data than a task requires is something you are expected to avoid. The practical risk varies by jurisdiction, but exporting everything and emailing the whole file to a third party is exactly the habit those rules exist to stop.

An accountant-safe export is small: one admin screen with a date range, one button, and a CSV with the financial columns and none of the personal ones.

A date range and a Download button

The plugin adds Accountant Export to the WooCommerce menu. It has an optional From date, an optional To date and a Download CSV button. Leave both dates blank for every order in the store, fill them in for a quarter or a month, or set only From to export everything since then.

The download starts straight away, one row per order, and opens directly in a spreadsheet. There is no confirmation step and nothing to configure.

Nine columns, none of them personal

Order ID, Date, Status, Payment Method, Items, Shipping, Tax, Total, Coupons. Each is a reference, a date, a figure or a payment method such as Credit Card or BACS. Shipping, tax and total are plain decimal numbers, and coupon codes are comma-separated.

Items summarises the order's line items in one cell (product name, quantity and unit price for each, joined by semicolons) rather than spreading them over several rows, which keeps the file easy to scroll and filter.

Customer name, email, billing and shipping address, phone number and IP address are not in the file, and neither is the WordPress user ID. Nothing links a row to a person.

A flat file, not an accounting import

The CSV does not connect to Xero, QuickBooks, FreshBooks or anything else, and it is not formatted for importing into them. If your accountant works inside accounting software, look at that platform's own WooCommerce connector. Those usually run under a data processing agreement, which answers the privacy question on different terms.

It is one row per order. It does not pivot by product, group by category, work out margin, or split VAT by country. For summaries you need a reporting plugin or a few minutes in the spreadsheet afterwards.

Every status is included: pending, processing, on-hold, completed, cancelled, refunded and failed. If your accountant only wants completed orders, filter the sheet, or add a status filter to the screen.

An accountant login instead of email attachments

Once the export is working, a read-only accountant login is worth considering. A custom capability can give access to the export screen and nothing else in wp-admin, so your accountant downloads their own file and nobody swaps spreadsheets by email.

A follow-up message can add a status checklist to the screen, a VAT rate per line item read from each product's tax class, or a wp_cron job that emails last month's export on the first of every month.

What you get

Included

  • An Accountant Export page under WooCommerce with optional From and To date fields
  • One CSV row per order: ID, date, status, payment method, line items, shipping, tax, total, coupons
  • All customer personal data stripped: no name, email, address, phone, or user ID
  • Safe to send to an external accountant without reviewing each column for personal information

Not included

  • Direct integration with accounting software such as Xero, QuickBooks, or FreshBooks
  • Pivot or summary views: no totals by product, category, or VAT rate
  • Country-level tax breakdowns for multi-jurisdiction filings
  • Filtering by order status: all statuses are included by default
  • Scheduled or automatic delivery of the export by email

Questions

Does this make my store GDPR compliant?

No plugin does that on its own. This one removes unnecessary personal data from one export, which reduces what you share with a third party and supports data minimisation. That is one requirement among many, and your wider obligations depend on your jurisdiction and how the store is set up.

Build it in Steem

The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.

Build this pluginAbout 55 credits. The free plan includes enough for one.
Read the prompt (433 words)

Build a WordPress plugin called WooCommerce Accountant Export. Plugin Name: WooCommerce Accountant Export. Description: Exports WooCommerce order data as a CSV with all customer personal information removed. Requires WooCommerce to be active. Single PHP file. No dependencies beyond WordPress core and WooCommerce. Check that WooCommerce is active at plugins_loaded using is_plugin_active. If WooCommerce is not active, add an admin_notices callback that displays a warning and return early from the rest of the setup. Register an admin submenu page using add_submenu_page: parent_slug woocommerce, page_title Accountant Export, menu_title Accountant Export, capability manage_woocommerce, menu_slug wc-accountant-export. Hook this to admin_menu. The admin page callback renders an H1 heading Accountant Export and a form with method POST and action pointing to the current page URL (use admin_url with the menu slug). The form contains: a nonce field with action wc_accountant_export, a label Order from with a date input named export_from (current value from $_POST if set, escaped with esc_attr), a label Order to with a date input named export_to (current value from $_POST if set, escaped with esc_attr), and a submit button with name do_export and value 1 labelled Download CSV. At the top of the admin page callback, before rendering the form, check whether do_export is set in $_POST. If it is: verify the nonce with check_admin_referer('wc_accountant_export'). Read export_from and export_to from $_POST using sanitize_text_field. Build $args for wc_get_orders: limit -1, orderby date, order DESC, status as an array containing wc-pending, wc-processing, wc-on-hold, wc-completed, wc-cancelled, wc-refunded, wc-failed. If export_from is not empty, set date_after in args to export_from. If export_to is not empty, set date_before in args to export_to. Set HTTP headers before any output: Content-Type text/csv; charset=utf-8, Content-Disposition attachment; filename=woocommerce-accountant-export- followed by date('Y-m-d') followed by .csv, Pragma no-cache, Cache-Control must-revalidate, Expires 0. Open a write handle with fopen('php://output', 'w'). Write a header row using fputcsv with these columns in order: Order ID, Date, Status, Payment Method, Items, Shipping, Tax, Total, Coupons. Loop over the orders returned by wc_get_orders($args). For each $order: build an $items_string by iterating $order->get_items() and for each item building the string get_name() . ' x' . get_quantity() . ' @ ' . number_format(($item->get_total() / max($item->get_quantity(), 1)), 2). Join multiple items with '; '. Write one row using fputcsv with: $order->get_id(), $order->get_date_created()->date('Y-m-d H:i:s'), $order->get_status(), $order->get_payment_method_title(), $items_string, number_format($order->get_shipping_total(), 2), number_format($order->get_total_tax(), 2), number_format($order->get_total(), 2), implode(', ', $order->get_coupon_codes()). Do not read or output: customer name, customer email, billing address fields, shipping address fields, customer phone, customer IP address, customer user ID, or any other personally identifying field. After the fputcsv loop, call fclose on the handle and then call exit to prevent WordPress from appending any HTML.