How to Force a Plugin to Claim Compatibility with WooCommerce HPOS

If you want to try WooCommerce HPOS in your website and it says some plugins are incompatible with HPOS, then you should check those plugins’ code first.

First make sure their codes don’t contain “update_post_meta or get_post_meta for orders. (for products it is ok). If they have, it can cause a problem.

If you are sure that the incompatible plugin has nothing to do with HPOS and doesn’t affect order processing, then you can claim it is compatible – without modifying its source code.

Open your theme’s functions.php and place such a block there:

Continue reading “How to Force a Plugin to Claim Compatibility with WooCommerce HPOS”

How to Clean POSTMETA Data of Old Orders After Switching to WooCommerce HPOS

Old Order Deletion Illustration

As of today there is no official guide for this simple need. If you have old orders more than 1000, you are right if you want to get rid of old orders – just to fasten your website.

So i decided to write my own script and apply to my web store with 30K order history.

Step1: I activated HPOS in dual-mode (aka safe mode).

Step2: 1 day passed and i disabled legacy mode and kept HPOS only

Step3: 1 more day passed and i deleted the oldest 5 orders from wp_postmeta.

Step4: Everything looked good, and i did the same for all orders.

Warning: You should take a backup before applying this code:

Continue reading “How to Clean POSTMETA Data of Old Orders After Switching to WooCommerce HPOS”