Testing Custom Order Tables / HPOS

Diagram of wp_posts and wp_postmeta to the four new HPOS tables

Have you heard? 2023 is the year that High Performance Order Storage (HPOS) also-known-as Custom Order Tables (COT) becomes standard in WooCommerce.

HPOS is opt-in based, but the core team has announced: “Orders will stop being synchronized to posts and postmeta tables in WooCommerce 8.0 in August 2023”. That sounds to me like our timeline for sites running the latest core code to be all ready by.

I originally forecasted that it would take years to fully roll out given all of the plugins, themes, and custom functions sitting out there that run various forms of get_posts() or WP_Query for products and orders, or custom SQL queries using the WPDB object. It appears there’s a more aggressive time table. I’m observing all of the Class A plugins upgrade and begin to state their compatibility with HPOS at this time.

Right now is the time to start converting custom functions over to C.R.U.D. (Create, Read, Update, Delete). This will get each site on track for both HPOS and the latest product lookup tables for performance, especially concerning variations and attributes. Upgrading code to C.R.U.D. benefits both of those important areas.

The developer guide on HPOS upgrading provides code audits (regular expressions) for developers to run in their code editor environments. Be on the lookout for any function calls around posts and meta anywhere your code concerns order and product records. Also be on the lookout for post editor metaboxes of order and product records. Finally, this guide also provides a hook for developers to state compatibility within each of their plugins and themes.

Technical references:

Testing HPOS

As of this writing the system is not advised for production use. We are in the testing phase, which is easy within a LocalWP sandbox copy of your site.

  1. Enable HPOS if no plugin incompatibilities show up next to the setting.
    • See WP Admin > WooCommerce > Settings > Advanced > Features
  2. Run the WP-CLI command to sync orders from old to new storage `wp wc cot sync`.
    • This usually runs in just a few minutes, even on databases with 200k orders and in local sandbox.
  3. In the new Custom data stores tab set Data store for orders to Use the WooCommerce orders tables.
  4. Turn OFF the setting for Keep the posts table and the orders tables synchronized.
  5. Test placing orders and ensuring all interfaces and integrations are seeing them.

Share this:

Note: I may receive compensation for referrals.

WP Engine - A smarter way to WordPress
The best email marketing tool, responsive templates, automations, Worldwide support, tracking and reports, Benchmark Email, free plan available
Sell everywhere. Use Shopify to sell in-store and online.
Klaviyo partner badge
Okendo Partner, certified
WooCommerce, the most customizable eCommerce platform for building your online business. Click to get started.
Jetpack, a stronger, customizable site without sacrificing safety. Click to get started.