Make a WooCommerce integration compatible with High-Performance Order Storage (HPOS)

domain: woocommerce.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Declare HPOS compatibility in your plugin by calling `\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true)` inside the `before_woocommerce_init` action hook.
  2. Audit all code that reads or writes order data: replace direct `$wpdb` queries on `wp_posts` and `wp_postmeta` with WooCommerce CRUD methods (`get_meta`, `update_meta_data`, `save`) on `WC_Order` objects.
  3. Replace any code using `get_post_meta` / `update_post_meta` with order-specific equivalents: `$order->get_meta()` and `$order->update_meta_data()` followed by `$order->save()`.
  4. Test the integration on a staging site with HPOS enabled (WooCommerce > Settings > Advanced > Features) and compatibility mode temporarily active to catch issues during migration.
  5. Disable compatibility mode (which syncs data between old posts table and new HPOS tables) only after verifying the integration works correctly with HPOS-only storage.
  6. If third-party plugins in the stack have not declared HPOS compatibility, WooCommerce will prevent enabling HPOS; coordinate upgrades across all plugins before switching production stores.

Known gotchas

Related routes

Implement WooCommerce High-Performance Order Storage (HPOS) compatibility for a custom plugin that queries order data via direct database queries
WooCommerce HPOS · 6 steps · unrated
Sync products and orders with WooCommerce REST API
woocommerce · 4 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans