HPOS sync on read to be disabled by default in WooCommerce 10.7

Starting in WooCommerce 10.7 (scheduled for April 14), sync on read for High-Performance Order Storage (HPOS) will be disabled by default. This change may affect stores that have both HPOS and compatibility mode enabled and rely on custom code or plugins that are not fully HPOS-compatible.

Affected stores will see a one-time dismissible admin notice after upgrading.

Background

When HPOS is used for order data storage and compatibility mode is enabled, order data is synced from HPOS to the posts table whenever an order is created or updated, keeping the posts table up to date as a secondary copy.

Sync on read, also referred to as “on the fly” synchronization, was an additional mechanism. It functioned in the opposite direction: if an operation wrote order data directly to the posts table, bypassing WooCommerce, the HPOS tables would get out of sync. To handle this, WooCommerce compared the update timestamps of both records during read operations and, if the post record was more recent, pulled those changes back into HPOS.

Both compatibility mode and sync on read were intended as interim measures to ease the transition to HPOS, giving developers and store owners time to adopt it. The posts table copy was always meant to be treated as read-only, with all order changes actually going through the WooCommerce API.

Why is this changing?

Sync on read can cause unexpected behavior when HPOS is being used for order data storage given it allows data modified outside of known workflows to override HPOS order data during read operations, possibly leading to unintended changes such as order status reversions or stale data overwriting current HPOS records.

With HPOS now mature and widely adopted, sync on read is no longer necessary for most stores and disabling it by default increases reliability and helps future-proof stores.

Who might be affected?

Stores that rely on custom code or plugins that write order data directly to the posts table (via wp_update_post, update_post_meta, or direct SQL) and expect those changes to be reflected in HPOS orders on the next read. If your store uses only HPOS-compatible plugins, this change should have no impact.

Not affected

  • Normal order synchronization. Orders will continue to sync from HPOS to the posts table when created or updated.
  • Stores using the legacy posts-based order storage. Sync on read only applies when HPOS is active. We do recommend migrating to HPOS for improved performance and scalability.

How to prepare and what to do after upgrading

You can test this change before 10.7 by disabling sync on read now, or re-enable it after upgrading if needed, using the woocommerce_hpos_enable_sync_on_read filter:

// Disable sync on read (will be the default in 10.7).

add_filter( 'woocommerce_hpos_enable_sync_on_read', '__return_false' );


// Re-enable sync on read after upgrading to 10.7.

add_filter( 'woocommerce_hpos_enable_sync_on_read', '__return_true' );

Re-enabling should be treated as a temporary measure, as sync on read may be completely removed in a future version. We recommend updating any custom code or plugins to use the WooCommerce CRUD layer rather than writing directly to the posts table or using generic WordPress functions.

If your store has been running with HPOS and compatibility mode without issues, you can consider disabling compatibility mode entirely under WooCommerce > Settings > Advanced > Features, which removes the need for synchronization altogether and can improve performance.


Leave a Reply

Your email address will not be published. Required fields are marked *