How to bulk delete old WooCommerce orders safely (and the reversible alternative)
Bulk deletion is the right tool for abandoned checkouts: failed, pending and cancelled orders that never became sales. For completed orders it is a one-way door; read what you lose before using it on those. Four methods, from safest to fastest.
Before any of them
- Full database backup (not just files). Test that it restores.
- Do it on staging first.
- Check what else references orders: subscriptions (a parent order of an active subscription must stay), bookings, memberships, invoice plugins with their own tables keyed by order ID.
Method 1: the orders screen (safe, slow)
WooCommerce → Orders → filter by status (Failed) and date → select all on the page → Bulk actions → Move to Trash. 20 orders per page by default; Screen Options raises it to 100-200. Trash can be emptied later, which makes this the only reversible method here. Fine up to a few thousand orders.
Method 2: WP-CLI (safe, fast)
# HPOS or legacy, through the WooCommerce API:
wp wc shop_order list --status=wc-failed --before="2026-01-01" --per_page=100 --field=id --user=admin \
| xargs -n1 -I{} wp wc shop_order delete {} --force --user=admin
Going through wc shop_order delete is what makes it safe: WooCommerce deletes items, meta, notes and refunds along with the order, in whichever storage is active, and fires the hooks other plugins listen to. Run it in a screen session; 10,000 orders take about an hour.
Method 3: a cleanup plugin (safe if it uses the API)
Several plugins on WordPress.org and woocommerce.com bulk-delete orders by status and age, on a schedule. Check one thing in their description: that they delete through WooCommerce's API, not with raw SQL. A plugin that "deletes directly from the database for speed" leaves orphaned item and meta rows on HPOS stores.
Method 4: SQL (fast, dangerous)
Direct DELETE statements on wp_posts/wp_postmeta (legacy) or wc_orders and its companion tables (HPOS), plus woocommerce_order_items, _itemmeta and comments. It works and it is the only method that handles a million rows in minutes. It also bypasses every plugin that stores order data in its own table, and on an HPOS store with compatibility mode on, deleting from one store and not the other leaves WooCommerce's sync in an inconsistent state. If you need this, you need a developer who knows your specific store.
The reversible alternative for completed orders
If the reason for deleting is speed (slow orders screen, search that times out), archiving gets the same result without losing the records.
OrderArc moves orders older than N months, with their items, meta, notes and refunds, into archive tables in the same database, in batches that are verified by count and checksum before the live rows are removed. Archived orders stay searchable and can be restored, one or all; the order number is reserved so it is never reused; WooCommerce Analytics is untouched.
Measured on a 100,000-order test store: archive 95,922 orders in 11 minutes, restore them, compare 6 million rows: zero differences.
Install it from WordPress.org: OrderArc – Order Archive for WooCommerce. Delete the abandoned checkouts with method 1 or 2; archive the real sales.
Sources
- WooCommerce WP-CLI overview
- WooCommerce: High-Performance Order Storage
- Measurements: OrderArc test store, October 2026
More guides
- WooCommerce orders page slow? Why it happens with many orders and how to fix it
- Should you delete old WooCommerce orders? Archive vs delete
- HPOS enabled but WooCommerce is still slow – what HPOS doesn't fix
- WooCommerce database too large: which tables grow and how to shrink them
- WooCommerce "auto archive old orders" feature request: three years later, what are your options