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.
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.
- Enable HPOS if no plugin incompatibilities show up next to the setting.
- See WP Admin > WooCommerce > Settings > Advanced > Features
- 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.
- In the new Custom data stores tab set Data store for orders to Use the WooCommerce orders tables.
- Turn OFF the setting for Keep the posts table and the orders tables synchronized.
- Test placing orders and ensuring all interfaces and integrations are seeing them.