You inherit a WooCommerce store with 1.8 million orders sitting in wp_posts and wp_postmeta. The admin order list takes eleven seconds to render. A consultant tells you to “just enable HPOS” — they mean well, they have not run the sync against a real catalogue. You enable it on a Friday afternoon, it starts a background migration, the dashboard says 4% after two hours, and you do not yet know that one of your installed plugins writes to order metadata via the legacy post API.
What’s happening
High-Performance Order Storage is the second-generation order data model for WooCommerce. Instead of cramming order data into wp_posts (post_type = shop_order) and wp_postmeta, HPOS uses dedicated tables: wc_orders, wc_order_addresses, wc_order_operational_data, wc_order_stats, and wc_orders_meta. Queries that used to JOIN wp_postmeta four times for a single order list now hit indexed columns directly.
The migration has three modes you toggle in WooCommerce → Settings → Advanced → Features:
- Posts only (legacy). Reads and writes go to
wp_posts. - Sync (compatibility). Reads from the authoritative table, writes go to both. This is the safe staging mode.
- HPOS authoritative, posts disabled. Reads and writes go to
wc_ordersonly. The point of no return — and the point at which any plugin still callingget_post_meta($order_id, …)for order data quietly breaks.
The “irreversible” framing is overstated for the sync mode and accurate for full cutover. Once you disable the posts table, WooCommerce stops writing to it. Going back means replaying writes from HPOS into wp_posts, which the core does not provide. Plan for the cutover to be one-way.
The hidden risk is plugin compatibility. WooCommerce maintains a runtime compatibility check (OrderUtil::custom_orders_table_usage_is_enabled()), but plugins declare their HPOS readiness via FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true). A plugin that does not declare anything is treated as incompatible and surfaces a warning, but a plugin that declares true and still uses get_post_meta ships you a silent bug — usually in the form of order meta that one side of the system writes and the other never sees.
How to verify
Start with a pre-flight inventory. Run this on a clone of production, not on production itself.
# Total order count by status
wp wc shop_order list --format=count
wp db query "SELECT post_status, COUNT(*) FROM wp_posts WHERE post_type='shop_order' GROUP BY post_status"
# Orphaned order meta — rows that point to deleted orders
wp db query "SELECT COUNT(*) FROM wp_postmeta pm
LEFT JOIN wp_posts p ON pm.post_id = p.ID
WHERE p.ID IS NULL AND pm.meta_key LIKE '\\_%'"
# Custom meta_keys actually used by plugins — anything outside the core set is suspect
wp db query "SELECT meta_key, COUNT(*) AS n FROM wp_postmeta pm
JOIN wp_posts p ON pm.post_id=p.ID
WHERE p.post_type='shop_order'
GROUP BY meta_key ORDER BY n DESC LIMIT 100"
Audit every active plugin against the HPOS compatibility list:
wp plugin list --status=active --format=csv > active-plugins.csv
# WooCommerce ships a runtime check — run it inside wp shell
wp shell
> Automattic\WooCommerce\Internal\Utilities\COTMigrationUtil::custom_orders_table_usage_is_enabled();
> \Automattic\WooCommerce\Utilities\FeaturesUtil::get_compatible_plugins_for_feature('custom_order_tables');
The third bucket is data integrity once sync mode is on. WooCommerce ships a verify command:
# Compare HPOS table against legacy posts for divergence
wp wc hpos-cli verify_cot_data --re-migrate
# Status of the background migration
wp wc cot status
wp wc cot count_unmigrated
A non-zero count_unmigrated after the background migrator claims to be done is a red flag — it usually means orders were created during the migration window and the sync handler missed them.
The fix
Run HPOS migration in four phases, with each phase gated on the previous one passing verification.
Phase 1 — pre-flight on a clone
# Take a full backup before anything
wp db export pre-hpos-backup.sql --add-drop-table
# Confirm DB engine + InnoDB row format
wp db query "SELECT @@version, @@innodb_default_row_format"
# Confirm WooCommerce version supports HPOS authoritative mode
wp plugin get woocommerce --field=version
If a critical plugin (Stripe, Subscriptions, Bookings, a custom shipping integration) does not declare HPOS compatibility, stop here. Open a ticket with the vendor, do not enable sync.
Phase 2 — enable sync mode
In Settings → Advanced → Features, enable “High-performance order storage” but keep “Use the WooCommerce orders tables” set to authoritative = legacy posts, with “Keep the posts table and the orders tables synchronized” enabled. Or via WP-CLI:
wp option update woocommerce_feature_custom_order_tables_enabled yes
wp option update woocommerce_custom_orders_table_enabled no
wp option update woocommerce_custom_orders_table_data_sync_enabled yes
Trigger the initial migration:
wp wc cot sync --batch-size=500
For 1.8M orders, expect this to run for hours. Run it in a screen or tmux session, watch DB load with mytop or pt-deadlock-logger. The background scheduler will resume on AS (Action Scheduler) — make sure cron is healthy:
wp action-scheduler run --batch-size=50
Phase 3 — soak period in sync mode
Leave sync mode running for at least 14 days under normal traffic. During this window:
- Re-run
wp wc hpos-cli verify_cot_dataweekly. - Tail the WooCommerce log for
compatibilitywarnings:wp wc logger list --format=csv | grep hpos. - Process at least one full month-end / VAT-return / refund cycle with sync mode on.
If a plugin causes drift between the two tables, this is when you find out — before you have flipped the irreversible switch.
Phase 4 — flip authoritative, disable legacy
wp option update woocommerce_custom_orders_table_enabled yes
wp option update woocommerce_custom_orders_table_data_sync_enabled no
Once you confirm reads are coming from wc_orders and writes are no longer hitting wp_posts, you can plan to drop the legacy data. We do not recommend dropping it immediately — keep wp_posts rows for shop_order for at least one full fiscal-year boundary in case tax authorities or auditors request original records in their original location. Disable the data sync, not the data itself.
For rollback during Phase 2 or 3, set woocommerce_custom_orders_table_data_sync_enabled back to no and revert authoritative to legacy. After Phase 4, rollback is a manual replay job — budget engineering time, do not assume the dashboard toggle is bidirectional.
Stack Harbor runs HPOS migrations end-to-end as part of enterprise WordPress hosting operations, including the plugin-compatibility audit and the soak-period verification. If your store is past the point where a Friday-afternoon enable feels safe, let’s scope the migration window together.