Skip to content

WooCommerce HPOS: what it is and how to migrate orders safely

· The AYT team · 6 min read

Person tying string around a cardboard parcel on a white table

HPOS (High-Performance Order Storage) is how WooCommerce keeps orders in tables of its own in the database, instead of WordPress's general wp_posts and wp_postmeta tables. It has been on by default for new stores since WooCommerce 8.2 (October 2023). An older store switches to HPOS under WooCommerce → Settings → Advanced → Features: you turn on syncing, wait for the orders to be copied, then choose HPOS as the main storage.

The switch happens without taking the store offline and can be reversed as long as syncing is on. The risk comes from plugins that read orders straight from wp_posts, so you do it on a staging copy first.

Why HPOS matters

In the old storage, each order is a "post" of type shop_order, and each detail (address, total, payment method) is a separate row in wp_postmeta. A store with tens of thousands of orders ends up with millions of rows in the metadata table, the same table that posts and products read from. Order searches and reports slow the whole site down.

HPOS puts orders in dedicated tables (wp_wc_orders, wp_wc_order_addresses, wp_wc_order_operational_data, wp_wc_orders_meta), with columns and indexes for the fields that are searched often. Orders no longer weigh on the tables the rest of the site uses.

Step 1: check whether you already have HPOS

Open the orders list in wp-admin and look at the address:

  • admin.php?page=wc-orders: HPOS is on;
  • edit.php?post_type=shop_order: the store still uses posts storage.

Or go straight to WooCommerce → Settings → Advanced → Features and see what's selected under "Order data storage".

Step 2: check your plugins

On the same page, WooCommerce shows a warning if active plugins don't declare HPOS compatibility, and won't let you switch until you sort them out.

  1. Update WooCommerce and every plugin that touches orders: payments, invoicing, couriers, exports, reports.
  2. For each plugin flagged as incompatible, check its page for a newer version that declares HPOS support. Romanian invoicing and courier plugins matter most, because they work directly with orders; see also e-Factura in WooCommerce.
  3. An abandoned plugin that won't get HPOS support has to be replaced before the switch.

Step 3: do the switch on staging

Creating a staging copy from the WordPress Toolkit

Create a staging copy of the store (details in the guide to a WordPress staging site) and run steps 4–6 there. On staging, check:

  • the orders list and searching by name, email and order number;
  • a new test order with each payment method you offer;
  • issuing the invoice and creating the shipping label from your plugins;
  • the Analytics reports and any order export your accountant uses.

After testing, don't push the staging database over the live store. New orders have come in on live in the meantime, and a full database copy replaces them. Use staging only as a test and repeat the steps directly on live.

Step 4: turn on syncing

On the live store, with a recent backup:

  1. Go to WooCommerce → Settings → Advanced → Features.
  2. Tick "Enable compatibility mode" (syncing orders between the two storages) and save.
  3. WooCommerce schedules background actions that copy orders in batches. You'll find them under WooCommerce → Status → Scheduled Actions, by searching for wc_run_batch_process.

On a store with many orders, copying takes anywhere from a few minutes to a few hours. Scheduled actions run through WordPress cron, so they need traffic or a real cron on the server; see WordPress cron.

Step 5: switch to HPOS

When the Features page no longer shows unsynced orders, choose "High-performance order storage" under "Order data storage" and save. From now on orders are read from the new tables.

Leave syncing on for a few days. While it's on, both storages hold the same data, and if a problem shows up you switch back to posts storage instantly, from the same page. Pick a quiet period for the switch and stay available afterwards.

Step 6: turn off syncing

After a few days without problems (new orders, invoices, shipping labels, refunds, reports), turn off compatibility mode. Syncing doubles every order write, so the full speed gain only arrives once it's off.

The old data in wp_posts and wp_postmeta stays in the database. You can delete it later with the WP-CLI command wp wc hpos cleanup all, if you have SSH access; it isn't required.

WP-CLI commands, if you have SSH

On servers with SSH access, WooCommerce has commands for the whole process: wp wc hpos status (overview), wp wc hpos sync (fast syncing, useful for large stores), wp wc hpos verify_data (compares the two storages) and wp wc hpos enable --with-sync.

Frequently asked questions

Will I lose orders if I turn on HPOS?

No, if you follow the steps: orders are copied, not moved, and while syncing is on you can switch back at any time. The risk comes from ignoring incompatibility warnings or overwriting live with the staging database.

Can I go back to the old storage after turning syncing off?

Yes, but first you have to turn syncing back on and wait for the new orders to be copied to the old tables. Only then can you switch the storage back.

HPOS on AYT

On AYT's plans you create the staging copy from the WordPress Toolkit and run your tests there. The staging sends no email and starts with WP-Cron off, so it doesn't repeat live's scheduled jobs; if syncing stalls, open WooCommerce → Status → Scheduled Actions and run the pending actions with "Run".

Under "Push to live", the panel gives you three options. "Everything" copies the database too, so it replaces the orders, posts and users that came in on live since the copy was made. "Files only" leaves live's database untouched. "Files and settings" adds the settings and plugin data changed on staging, so it would also carry your test's order storage choice to live. For HPOS, push nothing: repeat the steps on live. Live is backed up automatically before any push.

There's no SSH, but the switch to HPOS happens entirely in WooCommerce's interface, and the daily backups, restored from the panel, cover you before the change on live. If you want scheduled actions to run without traffic, you add a real cron job from the Cron Jobs page.

More articles

All articles