Skip to content
WooRescueHQ

WooCommerce / HPOS

WooCommerce HPOS: problems, migration and custom code

High-Performance Order Storage (HPOS) moves WooCommerce orders from the WordPress posts tables into dedicated order tables. Stores get faster order queries; code that reads orders the old way stops seeing them.

Short answer

HPOS stores orders in dedicated tables such as wp_wc_orders instead of wp_posts and wp_postmeta. Code that uses get_post_meta(), WP_Query or direct SQL on orders breaks once HPOS is the authoritative storage. Fix it by using the WooCommerce order API (wc_get_orders(), wc_get_order(), $order->get_meta()), and migrate with compatibility mode enabled so both storages stay in sync.

Specific problems

Common HPOS problems

Custom code that stops seeing orders

get_post_meta(), WP_Query with shop_order and SQL on wp_posts.

/woocommerce/hpos/custom-code/

Incompatible extensions

WooCommerce refuses to enable HPOS while incompatible plugins are active.

Migration and synchronisation

Orders pending sync, slow migrations on large stores, errors during sync.

Data differences between storages

Orders or meta that disagree between the posts tables and the order tables.

Legacy order tables

Reports, exports and integrations still reading the old tables.

Direct database queries

SQL in custom code, reporting tools and external integrations.

What changes with HPOS

Orders used to be WordPress posts of type shop_order, with their data spread across wp_posts and wp_postmeta. With HPOS, orders live in dedicated tables — wp_wc_orders, wp_wc_orders_meta, wp_wc_order_addresses and wp_wc_order_operational_data — designed for order queries.

Code that uses the WooCommerce order API keeps working, because the API reads whichever storage is authoritative. Code that bypasses it does not.

Breaks with HPOS Works with both storages
get_post_meta( $order_id, '_key', true ) wc_get_order( $order_id )->get_meta( '_key' )
update_post_meta( $order_id, … ) $order->update_meta_data( … ); $order->save();
new WP_Query( [ 'post_type' => 'shop_order' ] ) wc_get_orders( [ … ] )
SQL on wp_posts / wp_postmeta for orders Order queries through the API

Compatibility mode is the safety net

With compatibility mode enabled, WooCommerce keeps the posts tables and the order tables synchronised. That allows a gradual migration: enable sync, let it finish, verify, switch the authoritative storage to HPOS, and keep sync on until you are sure — so switching back remains possible.

Frequently asked questions

What is WooCommerce HPOS?

High-Performance Order Storage: a storage system that keeps orders in dedicated database tables instead of the generic WordPress posts and postmeta tables. It is the default for new stores since WooCommerce 8.2.

How do I know whether my store uses HPOS?

Go to WooCommerce → Settings → Advanced → Features. It shows which order storage is authoritative and whether compatibility mode (synchronisation) is enabled.

Why does get_post_meta() return nothing for orders?

Because with HPOS authoritative, order data lives in the order tables, not in wp_postmeta. Read it through the order object: wc_get_order( $id )->get_meta( 'key' ).

$ describe the problem

Have a WooCommerce problem?Request a diagnosis.

Tell us what is failing, what changed recently and the business impact. We review every request and recommend the appropriate next step.

Request a diagnosis See services and prices

Never send passwords, API keys or card data through the form.

Diagnosis from€299

Request a diagnosis