All guides

Archive old WooCommerce orders without a paid plugin: a tool you can build today

· 5 min read

A WooCommerce store that has been running for a year or two accumulates thousands of orders. Most are completed and paid, some are cancelled, and none of them need to appear in the main orders view alongside today's work. The admin slows down, filters get harder to use, and every report has to wade through old data before it shows what you actually want.

The standard advice is to install an archiving plugin, but the capable ones are paid. If you have a single store and a clear idea of what you need, a custom plugin built to spec does the job without a subscription, and it takes about five minutes to generate.

What one build gives you

  • Bulk-archiving WooCommerce orders older than a configurable number of days
  • Exporting selected orders to CSV before archiving
  • A separate archived orders view with individual unarchive controls per row
  • Settings for the age threshold and which order statuses are included in the queue

What it does not do

  • Permanently deleting orders from the database
  • Automatically archiving orders on a schedule without manual action
  • Hiding archived orders from WooCommerce Analytics reports
  • GDPR erasure requests or anonymising customer data on archived orders

Export and Archive Old Orders for WooCommerce does these. This covers the part most sites use.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

Build a WordPress plugin for WooCommerce that archives old orders. Add a settings page under WooCommerce > Archive Orders > Settings with two fields: a number input for the age threshold in days (default 365) and a checkbox list of WooCommerce order statuses to include in the archiving queue (completed and cancelled checked by default, processing unchecked). Register a custom WooCommerce order status called Archived (slug wc-archived) that is excluded from the main WooCommerce orders admin list. Add an admin page called Archive Orders under the WooCommerce menu with two tabs: Queue and Archived. The Queue tab shows a table of all orders older than the configured threshold that match the selected statuses, with columns for order number, date, status, customer name, billing email, and order total. Include checkboxes per row, a Select All control, a Bulk Archive button that changes the status of selected orders to wc-archived via AJAX, and an Export to CSV button that downloads selected orders as a CSV file with those same columns. The Archived tab shows all orders with wc-archived status using the same table columns, with a per-row Unarchive button that reverts each order to its previous status stored in order meta before the archive action.

Build this pluginAbout 55 credits · the free plan includes enough for one

Why old orders are a problem

WooCommerce stores every order in the WordPress database as a post, and every order attribute as post meta. After a few years of trading, the orders table can hold tens of thousands of rows. That is not a database problem in itself, but it is an admin problem: the orders list, every filter, every export, and every report query runs across the full dataset.

The more immediate issue is operational. Searching for a current order by customer name or order number returns results spread across years of history. Bulk-processing refunds or shipping updates on today's orders means scrolling past completed orders from three years ago. Archiving moves the historical orders somewhere you can still find them, without them cluttering the view you use every day.

Why not just delete them?

Permanently deleting orders is usually wrong. Most jurisdictions require businesses to keep order records for several years for tax purposes. A refund dispute that arrives months later requires the original order record. Deleting also removes the customer purchase history, which affects loyalty programmes and GDPR deletion requests where you need to know what data you hold.

Archiving adds a separate order status. Archived orders stay in the database and are accessible when you need them, but they are hidden from the main orders view and excluded from your day-to-day filters. That is the right compromise for almost every store.

What the plugin delivers

A Steem build for this job adds a WooCommerce > Archive Orders admin page and a settings page. The settings page has two fields: the age threshold in days (orders older than this appear in the archiving queue, default 365) and a checkbox list of order statuses to include (completed and cancelled are checked by default, processing is not).

How to install and use it

Paste the prompt below into Steem and download the generated zip. Install it under Plugins > Add New > Upload. Go to WooCommerce > Archive Orders > Settings and set the age threshold to match your needs. The default of 365 days means any completed or cancelled order older than one year appears in the archiving queue.

Open WooCommerce > Archive Orders. Select the orders you want to move, export a CSV backup if you want one, then click Bulk Archive. The orders disappear from your main orders list and reappear on the Archived tab. Unarchive any order individually if you need it back in the main view.

When a managed plugin makes more sense

If you need automatic scheduled archiving without manual intervention, a WP-Cron hook handles that. Adding it to a custom build is a second prompt, but it is a separate job from the one described here.

If you manage multiple WooCommerce stores and need centralised archiving rules, a per-site custom plugin is less convenient than a managed solution. For a single store with a backlog of old orders, a custom build gives you exactly what you need and nothing you do not.

Questions

Can I still find archived orders if I need them?
Yes. Archived orders remain in the database and appear on the Archived tab of the plugin's admin page. You can also filter by the Archived status in WooCommerce > Orders if you need to search by customer name or order number.
Will archiving affect WooCommerce reports?
Archived orders are excluded from the standard WooCommerce Analytics reports because they carry a non-standard status. If you rely on historical revenue figures in the built-in reports, export a CSV before archiving.
Is it safe to archive completed orders for tax purposes?
Archiving only changes the order status. The order record, line items, customer details, and payment data remain in the database. Your tax records are intact. The only change is that the orders no longer appear in your day-to-day admin view.
Can I unarchive an order if I archived it by mistake?
Yes. The Archived tab shows all archived orders with an Unarchive button per row. Clicking it reverts the order to its status before it was archived.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

Build a WordPress plugin for WooCommerce that archives old orders. Add a settings page under WooCommerce > Archive Orders > Settings with two fields: a number input for the age threshold in days (default 365) and a checkbox list of WooCommerce order statuses to include in the archiving queue (completed and cancelled checked by default, processing unchecked). Register a custom WooCommerce order status called Archived (slug wc-archived) that is excluded from the main WooCommerce orders admin list. Add an admin page called Archive Orders under the WooCommerce menu with two tabs: Queue and Archived. The Queue tab shows a table of all orders older than the configured threshold that match the selected statuses, with columns for order number, date, status, customer name, billing email, and order total. Include checkboxes per row, a Select All control, a Bulk Archive button that changes the status of selected orders to wc-archived via AJAX, and an Export to CSV button that downloads selected orders as a CSV file with those same columns. The Archived tab shows all orders with wc-archived status using the same table columns, with a per-row Unarchive button that reverts each order to its previous status stored in order meta before the archive action.

Build this pluginAbout 55 credits · the free plan includes enough for one

Read next

Other plugins you can build this way

Each loads into the composer, ready to edit.