Title: Detecting HPOS Data Sync
Last modified: May 13, 2024

---

# Detecting HPOS Data Sync

 *  [iammvc](https://wordpress.org/support/users/iammvc/)
 * (@iammvc)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/detecting-hpos-data-sync/)
 * Hi!
 * We need to disable some plugin hooks when WC is migrating orders to HPOS and 
   I was wondering if you have a flag of some sort (like DOING_CRON or DOING_AJAX)
   that we could use for this?
 * Thanks in advance!
 * Mike

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Afzal (woo-hc)](https://wordpress.org/support/users/afzalpansuvi/)
 * (@afzalpansuvi)
 * [2 years ago](https://wordpress.org/support/topic/detecting-hpos-data-sync/#post-17753171)
 * Hi [@iammvc](https://wordpress.org/support/users/iammvc/),
 * Thank you for reaching out to us! I understand you’re looking for a way to detect
   when WooCommerce is migrating orders to High-Performance Order Storage (HPOS).
   WooCommerce does provide a way to check if the HPOS migration is happening. You
   can look for a specific action hook that’s triggered during the migration process.
   This hook can be used to determine when the migration is taking place and to 
   disable other hooks accordingly. To give you the most accurate guidance, could
   you please provide a bit more information about your setup? Specifically:
    - Which version of WooCommerce are you currently using?
    - Are you looking to disable hooks globally or conditionally for specific orders?
    - Could you share an example of the hooks you’re trying to disable?
 * In the meantime, you can find more information about HPOS and its implementation
   in the WooCommerce documentation [here](https://woocommerce.com/document/high-performance-order-storage/).
 * Looking forward to your response to assist you further!
 *  Thread Starter [iammvc](https://wordpress.org/support/users/iammvc/)
 * (@iammvc)
 * [2 years ago](https://wordpress.org/support/topic/detecting-hpos-data-sync/#post-17759123)
 * Hi [@afzalpansuvi](https://wordpress.org/support/users/afzalpansuvi/)
 * Thanks for getting back to me!
 * We are currently testing with WooCommerce 8.8.3 and we would like to disable/
   skip our hooks globally during the migration/sync process.
 * To give you a bit of context, our code is hooked into `woocommerce_order_status_completed`
   so for every order that gets migrated, our code is being executed a second time.
   We would like to be able to check for a flag (e.g. `DOING_CRON`) so we could 
   unhook our code until the process completes.
 * Is this possible?
 * Kind regards
 * Mike
 *  [ckadenge (woo-hc)](https://wordpress.org/support/users/ckadenge/)
 * (@ckadenge)
 * [2 years ago](https://wordpress.org/support/topic/detecting-hpos-data-sync/#post-17761146)
 * Hi Mike [@iammvc](https://wordpress.org/support/users/iammvc/),
 * Helping out with custom coding of this nature is outside the scope of support
   that our support staff can help out with here, although I would recommend the
   following:
    1. Running the exact question you’re asking, along with the code provided, through
       an AI platform like ChatGPT for recommendations/changes to your code;
    2. Checking whether there are existing plugins in the WordPress plugin repository
       that might be doing that already.
    3. Joining our WooCommerce Slack community (it does have a developer channel where
       you can ask coding questions): [https://woo.com/community-slack/](https://woo.com/community-slack/)
 * Hope it helps!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Detecting HPOS Data Sync’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [ckadenge (woo-hc)](https://wordpress.org/support/users/ckadenge/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/detecting-hpos-data-sync/#post-17761146)
 * Status: not resolved