High-Performance Order Storage (HPOS) helps WooCommerce handle orders more efficiently, but switching it on can reveal compatibility problems with custom plugins. If you’re seeing unexpected errors or missing order data, don’t worry: most WooCommerce HPOS compatibility issues can be traced to how a plugin reads or updates order information.
In this guide, we’ll walk through practical ways to identify and fix those issues, test your changes safely, and keep your store running smoothly. With a few careful checks, you can help your custom plugins work well with HPOS and enjoy the performance benefits with confidence.
Diagnose WooCommerce HPOS compatibility issues in custom plugins
When an order screen behaves differently after a storage change, the quickest route to a fix is to narrow down where the mismatch begins. A few checks can help you distinguish a settings problem from plugin code that still expects the older order-storage system.
Check HPOS settings, plugin notices, and WooCommerce logs
Start in WooCommerce > Settings > Advanced > Features and note whether HPOS is enabled, whether compatibility mode is active, and which order storage option is authoritative. These details matter: compatibility mode can synchronize order data between storage systems, but it may also mask a plugin that is reading from the wrong place.
Next, look for compatibility warnings in the admin area and check WooCommerce > Status > Logs around the time the problem occurred. Record the error message, timestamp, and the action that triggered it—such as creating a refund or updating an order. The WooCommerce HPOS documentation explains the available settings and compatibility checks.
Use those clues to focus your code review. A notice naming a plugin, paired with a log entry showing an outdated query, is more useful than changing several settings at once.
Find legacy order queries and direct database access
Once you have a likely plugin to inspect, search its code for order queries that assume orders are stored as posts. Common warning signs include calls to getposts() or WPQuery for orders, and direct queries against wpposts or wppostmeta. These approaches may work with legacy storage but fail to return reliable results with HPOS.
Prefer WooCommerce’s order APIs, such as wcgetorder() and wcgetorders(), and use the order object’s methods to read or update data. For example, a plugin that fetches an order through wcgetorder() can avoid relying on where WooCommerce stores its records. Also check for hard-coded order IDs, status values, or metadata assumptions that may affect related features.
If a query is necessary, verify that it uses supported WooCommerce APIs and test its results with HPOS enabled. This is especially important for reports, scheduled tasks, and integrations that run outside the usual checkout flow.
Reproduce WooCommerce HPOS compatibility issues in a staging environment
Before changing live code, recreate the issue on a staging site with the same WooCommerce version, plugin settings, and order workflow. A controlled copy makes it easier to isolate the custom plugin from theme conflicts or other extensions.
Test the specific actions that failed, then compare results with HPOS disabled or compatibility mode enabled where appropriate. Use sample orders and confirm that creation, edits, refunds, and background processing behave as expected. Once the fix passes, document the tested configuration and deploy during a quieter period with a rollback plan ready.
Update custom plugin code for HPOS data storage
Once you’ve found the code path behind the failure, the next step is to remove assumptions about where an order lives. A small change to how a plugin reads and saves order data can make it work across storage setups without disrupting familiar store workflows.
The first improvement is to route order operations through WooCommerce rather than WordPress post functions. This keeps storage details behind the supported interface.
Use WooCommerce CRUD objects instead of querying order tables directly
Use wcgetorder() to load an order and wcgetorders() to retrieve matching orders. Then read and update values through the order object—for example, use $order->getbillingemail() or $order->updatemetadata(), followed by $order->save() when you make changes.
This CRUD approach lets WooCommerce handle the underlying storage. Avoid treating orders as posts with getposts(), WPQuery, or direct SQL against order tables. The WooCommerce HPOS developer documentation describes supported order APIs and query patterns.
When a plugin needs custom order metadata, store it through the order object too. For example, use $order->getmeta() to retrieve a value instead of assuming it is in a particular database table.
Some stores still use legacy order storage, so compatibility should be deliberate rather than assumed. The same WooCommerce APIs can support both storage modes when the plugin avoids storage-specific access.
Support both HPOS and legacy order storage where needed
Test the plugin against the storage configurations your customers may use, including compatibility mode if it is part of your deployment plan. Check that order creation, updates, and metadata retrieval produce the same results in each configuration.
After testing, declare compatibility with HPOS using WooCommerce’s FeaturesUtil::declarecompatibility() mechanism, typically from the beforewoocommerceinit hook. Only make this declaration after verifying the plugin’s behavior; it signals compatibility, but does not fix code that relies on legacy tables.
Storage-neutral code is only useful if it works across the plugin’s real entry points. Review the workflows that touch orders, including ones that may run outside the main order screen.
Review checkout, admin, reporting, and integration workflows
Test checkout hooks and payment callbacks, then check admin actions such as editing an order or issuing a refund. Also inspect scheduled jobs, exports, and reports: these often contain older queries that may not be obvious during a routine checkout test.
- Reports: verify date ranges, statuses, and pagination return complete results.
- Integrations: confirm webhooks and background syncs use supported order APIs.
- Updates: check that metadata and totals remain correct after saving.
Keep a short regression checklist with expected results for each workflow. That makes future plugin updates easier to validate and helps prevent WooCommerce HPOS compatibility issues from returning.
Test and maintain a reliable HPOS setup
A fix is only dependable if it holds up beyond the single action that exposed the problem. Before calling the work complete, verify the affected behavior, check nearby workflows, and plan how you’ll spot trouble after the change reaches your live store.
Start by comparing the failing workflow with its expected result, then check that the same result holds across the order actions your plugin supports.
Verify WooCommerce HPOS compatibility issues are resolved
Repeat the steps that originally triggered the issue using test orders, and confirm the plugin now reads or updates the correct values. Check both the customer-facing result and the saved order data—for example, whether a refund appears correctly in the admin and whether the related integration receives the expected update.
Also look for side effects, such as duplicate metadata, missing status changes, or an action running twice. If the plugin supports both HPOS and legacy storage, verify the relevant configurations separately; a successful test in one mode doesn’t prove behavior in the other. The WooCommerce HPOS developer documentation can help you confirm that your checks align with supported behavior.
With the original failure addressed, broaden testing before deployment so a targeted fix doesn’t unintentionally disrupt another order workflow.
Run regression tests before deploying plugin changes
Build a short regression checklist around the plugin’s order-related features. Include the common path and less frequent actions, such as editing an order, creating a refund, processing a webhook, and running a scheduled export. Where possible, test with different order statuses and realistic data, rather than relying on a single sample order.
- Confirm results: totals, status, and custom metadata remain accurate after saving.
- Check edge cases: missing optional fields or cancelled orders don’t cause errors.
- Review automation: background jobs complete without duplicate updates.
Record the WooCommerce version, storage mode, and plugin version used for testing. That small release note makes later comparisons much easier if a customer reports a regression.
Once the change passes staging checks, use a controlled rollout and keep an eye on the store’s signals rather than assuming the deployment is finished.
Monitor logs, backups, and order data after rollout
After release, review WooCommerce logs and server error reports for new warnings tied to the plugin. Compare a sample of recently processed orders with expected totals, statuses, and metadata, and watch for failed integrations or scheduled tasks. A brief check soon after deployment can catch problems before they affect many orders.
Keep a current backup and a clear rollback option before making production changes. If an issue appears, pause the affected plugin workflow where practical, preserve relevant logs, and restore the last known-good version or backup according to your recovery plan. This gives you a safer path to investigate WooCommerce HPOS compatibility issues without losing track of order changes.
Keep Your Custom Plugins Ready for HPOS
WooCommerce HPOS compatibility issues can seem daunting, but they’re often a sign that a custom plugin relies on outdated assumptions about how order data is stored. Start by tracing the problem through settings, logs, and a staging test, then update the plugin to use WooCommerce’s supported order APIs.
Compatibility is more than a code change: checkout, admin actions, reports, and integrations all need to work as expected. Thorough regression testing, a careful rollout, and ongoing monitoring help protect order data and catch problems early.
With storage-independent code and a practical maintenance routine, your custom plugins can keep pace with WooCommerce while your store benefits from HPOS. Take it one workflow at a time, and you can move forward with confidence.