Skip to content

Shelvane

Shelvane gives WooCommerce an Archived order status. Archived orders are left out of the All view of WooCommerce > Orders and listed under their own Archived link. Only the status changes: nothing is deleted and nothing is moved out of the order tables.

Feature How it works
Archived status One archive status per archivable status: wc-shelved (completed), wc-shelved-cancel, wc-shelved-refund, all labelled Archived and registered with show_in_admin_all_list off. Archived orders drop out of All and are listed under one Archived view whose count covers all three.
Bulk Archive Bulk actions > Archive archives completed, cancelled and refunded orders. Other statuses are skipped and the notice says how many.
Bulk Restore Bulk actions > Restore from the archive puts back the status each order had before: the one its archive status stands for, or the status kept in the order meta _shelvane_from when code archived an open order through the REST API.
Auto-archive Off by default. Once a day (Action Scheduler) it archives orders placed more than N days ago, 365 by default and at least 30, with the statuses you pick: completed by default, cancelled and refunded optional.
Restore all A button in the settings restores every archived order in the background and turns auto-archive off.
Order note Each archive and restore adds a private order note.

WooCommerce > Settings > Advanced > Order archive. The Plugins screen links there and to the Archived view.

Setting Default Meaning
Auto-archive off Archive old orders once a day.
Older than (days) 365 Counted from the date the order was placed. Values under 30 are treated as 30.
Statuses to archive Completed Any of Completed, Cancelled, Refunded.
  • Status hooks, webhooks and emails. Archive and restore write the status straight to the order tables (HPOS, and the posts table when it holds a copy). No woocommerce_order_status_* hook fires and the order is not saved, so no woocommerce_update_order, no order.updated webhook, no email, stock change or ERP sync. The filter shelvane/fire_status_hooks (return true, receives the order) makes them ordinary status changes again, with WooCommerce's own mail still unhooked.
  • Dates. The completed date and the modified date do not change.
  • WooCommerce Analytics. The stats row of an archived order is not touched and keeps the previous status (wc-completed, wc-cancelled, ...); a later resync writes the previous status too, refunds included. Revenue, order counts and the status filters do not change when you archive or restore.
  • Every other status list. Shelvane adds the archive status of each listed status wherever WooCommerce reads a list: the paid statuses (woocommerce_order_is_paid_statuses: total spent, "bought this product" checks, paid checks), the legacy Reports screen and dashboard widget (woocommerce_reports_order_statuses, and order_status / parent_order_status in woocommerce_reports_get_order_report_data_args, so refunds of archived orders stay in). The customer's order count reads every registered status. An archived completed order counts as completed; archived cancelled and refunded orders count as cancelled and refunded.
  • Personal data retention. The trash and anonymise jobs (woocommerce_trash_cancelled_orders_query_args and the two anonymise filters) also take archived orders of that status, on the same schedule.
  • My account. The customer still sees the order, with the previous status as its label. Downloads of an archived completed order keep working.

Checked in WooCommerce 11.3.1:

  • filtering the orders list by status, date, sales channel and customer, and searching it;
  • personal data retention (Settings > Accounts & Privacy): trashes pending, failed and cancelled orders and anonymises refunded and completed ones after a set time;
  • the Trash, which hides orders from the customer too.

There is no status kept out of All and no archiving by age, which is what Shelvane adds.

  • Searching in the All view does not find archived orders. Open the Archived view and search there.
  • The order screen's status field offers Archived only on completed, cancelled and refunded orders. A move into an archive status made there or through the REST API runs as a normal WooCommerce status change (hooks fire), and a wrong archive status is corrected to the one that matches.
  • Code that asks for orders of one exact status (the REST API with status=completed, another plugin's wc_get_orders() by status) does not get archived orders and reads shelved, shelved-cancel or shelved-refund as their status. WooCommerce's own lists above are covered.
  • Archived to Completed from the order screen or REST sends the Completed order email and stamps a new completed date, like any status change. Use Restore from the archive to stay silent.
  • The Analytics Orders report's advanced status filter lists Archived three times; no Analytics row has that status, so it matches nothing. Analytics settings leave the archive statuses out.
  • Auto-archive and Restore all change at most 200 orders per run and queue another run while there are more.

Before you deactivate, the Plugins screen shows how many archived orders will be restored. Deactivation restores every archived order to its previous status in SQL batches of 500, with no hooks and no emails, adds an order note, and turns auto-archive off. On a network deactivation it does this for every site. Measured with 5 000 archived orders: 2.1 to 2.5 seconds for the whole deactivation request from the Plugins screen, HPOS and posts storage. Reactivating Shelvane archives nothing again. Restore every archived order in the settings does the same without deactivating, 200 at a time in the background. Uninstall deletes the settings only.

WordPress 6.5, PHP 8.1, WooCommerce 10.1 or newer. HPOS on and off.