🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

WooCommerce Order Vault Setup Guide

Updated 10 min read WooCommerce Store & Checkout
On this page
  1. What you need
  2. Install and activate
  3. Why archive old orders
  4. Set the rules
  5. Preview the result (dry run)
  6. Run it: one batch, a full run or a schedule
  7. How an order is moved
  8. Find archived orders
  9. View an archived order
  10. Restore orders
  11. Export to CSV
  12. My account
  13. Reports and Analytics
  14. How it differs from deleting or trashing orders
  15. Uninstall
  16. Frequently asked questions

The WooCommerce Order Vault add-on moves old, finished orders out of the main WooCommerce order tables and keeps them in its own archive tables, where they stay searchable, viewable, exportable to CSV and restorable at any time. You choose which orders qualify (completed, refunded or cancelled orders older than a number of months), preview the result as a dry run, and let a scheduled job move them in small batches through WooCommerce’s own Action Scheduler. Every order moves as one unit with its items, item meta, notes, addresses, refunds and Analytics rows, and a restore writes back exactly the same database rows. This guide covers installation, the rules, the dry run, the schedule, the archived orders screen, restoring, the CSV export, My account and what changes in reports.

What you need

You need WooCommerce 10.7 or newer on WordPress 6.8 or newer and PHP 7.4 or newer. The add-on works with every WooCommerce order storage: High-Performance Order Storage (the custom order tables that new stores use), the older post storage, and compatibility mode, where WooCommerce keeps both copies in sync. It detects the storage your store uses and moves the rows from wherever they are, so you do not need to change anything when you switch storage later.

Scheduled archiving uses Action Scheduler, the job queue that ships with WooCommerce, so no extra cron service is needed. Opening the add-on’s screens and changing its rules needs the manage_woocommerce capability, which administrators and shop managers have.

Install and activate

  • Upload the add-on zip in Plugins → Add New → Upload Plugin and activate it. The archive tables are created on activation.
  • Go to WooCommerce → Order Vault → License, enter your GravityExtra license key and press Activate License.
  • Open the Rules & schedule tab to set which orders are archived. Nothing is archived until you press a run button or switch on automatic archiving.

Without an active license, archiving (scheduled and manual) and the CSV export pause. Viewing, searching and restoring archived orders always keep working, so your order history is never locked away.

Why archive old orders

WooCommerce keeps every order forever in the same tables it uses for today’s orders. After a few years a busy store can hold hundreds of thousands of finished orders, each with dozens of rows of items, meta and notes. The order list, the order search, customer order counts and many plugins that query orders get slower, backups get bigger and staff scroll past orders nobody will touch again. Deleting old orders is not an option for most stores: you still need them for accounting questions, warranty claims, returns and customers who want an old invoice. An archive gives you both: small, fast live tables and a full history one search away.

Set the rules

On the Rules & schedule tab you decide which orders move to the archive.

  • Older than: the number of months since the order date. The default is 24 months.
  • Order statuses: Completed, Refunded and Cancelled. Only finished orders can be archived; pending, processing, on-hold and failed orders always stay where they are.
  • Keep orders paid with: tick payment methods whose orders must never be archived, for example a payment method your accountant still reconciles by hand.
  • Keep orders containing: search and pick products. Orders that contain one of them, or one of their variations, are never archived. This is useful for gift cards, memberships or products with a long warranty.

Some orders are always kept, whatever the rules say:

  • Orders linked to a subscription: parent orders of a subscription and renewal, switch or resubscribe orders. The subscription record itself is never touched.
  • Orders with a pending refund, either a refund record that is not completed yet or a payment gateway that reports a refund as still pending.
  • Orders that have other linked child orders (refunds are not child orders in this sense: they move with their order).
  • Orders you restored from the archive before. A restore is a decision to keep the order live, so the schedule does not move it again.
The Rules and schedule tab: order age, statuses, payment method and product exclusions, the always-kept list, the schedule settings and the dry-run preview with counts
Rules, schedule and the dry-run preview on one screen.

Preview the result (dry run)

Below the rules, the Preview (dry run) card shows what the saved rules would do right now, without changing anything. You see how many orders would be archived, how many are old enough with a chosen status, and how many are kept by an exclusion, with one line per reason: subscription, pending refund, child orders, restored earlier, excluded payment method and excluded product. An order can have more than one reason, so these lines can overlap. The card also shows the split by status, the date range of the orders that would move, the time of the last batch and the next scheduled run. Change a rule, save, and the preview updates.

Run it: one batch, a full run or a schedule

There are three ways to archive:

  • Archive one batch now moves one batch (25 orders by default) while you wait and shows the result. This is a good first step: check the archived orders screen, open a few orders, and continue when you are happy.
  • Start a full run in the background queues a run in Action Scheduler. It moves one batch per scheduled action and queues the next batch until nothing is left or the limit per run is reached.
  • Automatic archiving runs the same job once a day at the hour you choose, or every hour. New orders that become old enough are moved on the next run.

Batch size (1 to 200, default 25) is the number of orders per scheduled action; small batches keep each action short on shared hosting. Limit per run caps how many orders a single run moves, so a first run on a large store can be spread over several nights. You can follow the jobs in WooCommerce → Status → Scheduled Actions, group geoa.

How an order is moved

Each order is moved on its own, inside a database transaction. First the add-on claims the order with a unique key in its archive table: if two runs start at the same time (a scheduled run and a click on the run button, for example), only one of them can claim a given order and the other skips it. It then checks the rules again for that order, reads every row that belongs to it and to its refunds, writes them to the archive tables, removes them from the live tables and reads both sides back. The move is committed only when the live rows are gone and the archived rows match a checksum taken before the move. If anything fails, the transaction is rolled back and the order stays live, complete.

The rows that move are the order itself (custom order table and posts, whichever the store uses), its meta, its billing and shipping addresses, its operational data, its line items, shipping, fee, coupon and tax lines with their meta, its notes and their meta, its refunds with the same parts, and its Analytics rows (order stats, product, tax and coupon lookups). Order numbers, customer links and refund relations are kept exactly as they were, because the rows keep their original ids. Download permissions are not moved, so customers keep their downloads.

Find archived orders

The Archived orders tab lists the archive, newest order first, 20 per page, with the order number, date, status, customer name and e-mail, total and archive date. Search by order number, by e-mail address or part of it, or by customer name, and narrow the list by order date and status. The list and the search run on the add-on’s own tables, so they stay fast with any number of archived orders.

The Archived orders tab: search by order number, e-mail or name, date range and status filters, the export button, bulk actions and the list of archived orders
The archived orders list with search, filters and bulk actions.

View an archived order

Click an order number to open a read-only view built from the archived rows: status, order date, completion date, payment method, archive date and customer (with a link to the user profile), billing and shipping addresses with e-mail and phone, the line items with quantities, item details and totals, discounts, shipping, fees and taxes, refunds with their reasons, the customer note, every order note (internal and to the customer) and the custom fields. Nothing can be edited here. To change, refund or resend e-mails for an archived order, restore it first.

A read-only archived order: status badges, dates, payment method, customer, billing and shipping addresses, items with totals, refund, order notes and custom fields
An archived order, read-only, with its refund and notes.

Under the order, the archive record shows how many database rows were archived for it, from which storage, and the start of its integrity checksum.

Restore orders

Use Restore under an order in the list, Restore to live orders on the order view, or tick several orders and choose Restore to live orders from the bulk actions. A restore writes back exactly the rows that were archived, with their original ids, and checks the result against the checksum taken when the order was archived; only then is the archived copy removed. The restored order is identical to the original: same number, customer, items, notes, refunds, dates and meta, and its Analytics rows come back too. No e-mails are sent and no stock changes, because nothing about the order changes.

If one of the original ids is now used by another record (this can happen on some database servers after a restart), the restore is refused and the archived copy is left untouched; the notice tells you why. Restored orders are not archived again automatically.

Export to CSV

Export the orders that match the current search and filters with the Export (CSV) button, a selection with the Export CSV bulk action, or one order from its view. The file has one row per order with the order id and number, order and completion dates in your site’s time zone, status, customer id, billing name and e-mail, payment method, currency, total, refunded amount, the items with quantities and the archive date. It opens cleanly in spreadsheet programs (UTF-8), and cells that start with a formula character are written as text.

My account

With Show archived orders in My account switched on (the default), customers see an Archived orders table under their orders, with a read-only view of each one: items, totals, addresses, refunds and the notes that were sent to them. Internal order notes are not shown, and customers can only open their own archived orders. Switch the option off to hide archived orders from customers.

My account, Orders: the customer's live orders and, below them, an Archived orders table with order number, date, status, total and a View button
Archived orders under the customer’s orders in My account.

Reports and Analytics

Archived orders are out of the live tables, so they are not in the WooCommerce order list or order search, and WooCommerce Analytics and the legacy Reports leave them out: revenue, orders, products, categories, coupons, taxes and customer totals only count live orders. A notice on the order list, Analytics and Reports says how many orders are archived and links to them. If you need an older period in a report, restore those orders first and archive them again later. An Analytics import of historical data does not see archived orders, but their Analytics rows are kept in the archive and come back with a restore.

How it differs from deleting or trashing orders

Trashing or deleting old orders also makes the order tables smaller, but the history is gone or one click from being gone, and a deleted order cannot be brought back. Exporting orders to a spreadsheet keeps a record, but not one you can restore, open in WooCommerce or show a customer. The Order Vault add-on keeps every row of every archived order in your own database, can show it, search it and export it, and can put it back exactly as it was. It is not a backup: keep your normal database backups.

Uninstall

Deactivating the add-on stops the schedule. Deleting the add-on removes its settings and history only when Delete the settings when the add-on is deleted is ticked, and the archive tables are removed only when they are empty. Deleting the add-on can never delete archived orders: restore them first if you stop using it.

Frequently asked questions

Does archiving change the order numbers? No. Orders keep their ids and order numbers in the archive and after a restore.

What happens to customer accounts? Nothing. Customers and their accounts stay as they are; the archived order keeps its link to the customer, and My account can still show it.

Can two archive runs collide? No. Each order is claimed with a unique key before it is moved, so an order can only be moved by one run, and a run that loses the claim simply skips that order.

Does the add-on contact any outside service? No. All work happens in your own database. The only outside requests are the GravityExtra license and update checks.

Questions or a store with special needs? Open a support ticket and we will help.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr