Same wc-admin_import_orders tasks every day
-
Hello,
I’m facing an issue where several orders are reimported every day by the wc-admin_import_orders scheduled action. The concerned orders have nothing specific and have been passed in 2022, 2023.
See : https://drive.google.com/file/d/1lD5i4ExqIMFiPPKY2InWV-pErDY7PPDc/view?usp=sharing
It’s pretty boring because it trigger any webhook based on “Order updated”. Can you help?
Thanks
Best regards
-
Hi @bvedgie,
Thank you for reaching out and for sharing the screenshot, it really helps add context.
From what I understand, you’re encountering an issue with WooCommerce Analytics where a scheduled background task,
wc-admin_import_orders, keeps re-importing older orders from 2022 and 2023 on a daily basis.If that’s correct, it would be helpful to learn a bit more about your setup. Please share your system status report by going to WooCommerce > Status > Get system report > Copy for support, and then paste it to pastebin.com and share the link here.
For context,
wc-admin_import_ordersis a WooCommerce Analytics scheduled action responsible for syncing historical or missing order data into the Analytics tables. This behavior is normally expected when Analytics is newly enabled, when data is missing from the Analytics tables, or if a previous import was interrupted or failed.However, since the same older orders are being re-processed repeatedly even though they are already completed and unchanged, this may point to an issue with WP-Cron, database write failures, or possibly object caching.
Once I have your system status report, it will be much easier to assist further. Also, could you please clarify how you identified that orders from 2022 and 2023 are the ones triggering this scheduled action?
Thanks for your reply, Moïse.
Please find here all files related to the issue : https://drive.google.com/drive/folders/1DOCcvUD-apWmJc540jgGyoUg-7NqGy42?usp=sharing
We took order #75876 for the example in the screenshots to show you that this order is already in the _wc_order_stats table and we still have scheduled tasks trying to import it.
Hope it helps.
Thanks
Hi @bvedgie,
Thanks for sharing the SSR and screenshots, that’s very helpful.
From what I see, the issue is caused by WooCommerce Analytics’
wc-admin_import_ordersscheduled action repeatedly trying to process orders that are already in the_wc_order_statstable. This usually happens when:- Previous imports failed partially, leaving the action in a
pendingorfailedstate. - Object caching (Redis, Memcached, etc.) prevents WooCommerce from marking the orders as fully processed.
- The Action Scheduler tracking gets out of sync, causing the same order to be re-queued.
Steps to Resolve
- Check Action Scheduler Table
- In
wp_actionscheduler_actions, look for entries withhook = wc_admin_import_ordersfor the affected order IDs. - If they are marked as
pendingorfailed, that explains why they keep re-running.
- In
- Temporary Manual Fix
- You can mark the stuck actions as
completein the database for specific orders:
UPDATE wp_actionscheduler_actions SET status = 'complete' WHERE hook = 'wc_admin_import_orders' AND args LIKE '%75876%';(Please take a backup before running this query.) - You can mark the stuck actions as
- Flush / Disable Object Cache
- If using Redis, Memcached, or other persistent caching, try flushing or temporarily disabling it.
- Rebuild Analytics Table
- Once the stuck actions are cleared, run:
wp wc admin analytics regenerate- This will cleanly re-sync all orders into
_wc_order_statsand prevent duplicates.
- Update WooCommerce
- Ensure both WooCommerce and WooCommerce Admin are updated to the latest versions to avoid known issues with
wc-admin_import_orders.
- Ensure both WooCommerce and WooCommerce Admin are updated to the latest versions to avoid known issues with
Following these steps should stop the repeated imports and the unnecessary triggering of “Order updated” webhooks. Let us know the results upon trying these steps.
- The step 2 isn’t relevant because they are already marked ‘complete’…
See : https://drive.google.com/file/d/1BOrU9p1KZi1C25eYRXBEQbaVXVuYqPYC/view?usp=sharing
2. I don’t understand the 5th point because we don’t use any additional “admin” plugin for Woocommerce.
-
This reply was modified 3 months, 1 week ago by
bvedgie.
Hi @bvedgie,
Thank you for getting back to us. To further clarify what my colleague is suggesting, there are cases where the values stored in the database don’t fully align with what’s shown in the admin interface. For example, even if actions appear as completed in the admin, they may still be marked as pending or failed at the database level, which can lead to repeated reattempts. Issues like this are often related to caching or plugin conflicts.
Please go ahead and follow steps 1 through 4 as outlined by @saivutukuru.
While doing so, kindly share your system status report by navigating to WooCommerce > Status > Get system report > Copy for support, then paste it to pastebin.com and share the link here. This will help me better understand your setup and assist you more effectively.
Hello, I think you didn’t checked the screenshots showing the actions COMPLETE in the DB.
Hi @bvedgie,
Thanks for drawing our attention to it. I also got to check your system report and would recommend these:
- I see you have Redis object cache, did you get a chance to clear it? Also temporarily disable it to see
- Since the tasks are marked as complete, it could be that the tables may still be partially populated. Go to WooCommerce → Status → Tools and try clearing transients, synchronize WooCommerce Analytics data, Clear analytics cache, Generate Related Order Cache.
- Enable HPOS at WooCommerce → Settings → Advanced → Featured
- Temporarily disable all other plugins except WooCommerce to rule oput conflicts. If the repeated imports stop, then one of the plugins are interfering
Let us know how it goes!
Hello,
We disabled Redis, we tried the 2nd sequence (clean, synchro, etc) and nothing’s better.
We won’t enable HPOS at this time.
So, we’re stuck in the same state.
Hi @bvedgie,
Thanks for your update. I understand that disabling Redis and following the clean and synchronisation sequence hasn’t resolved the repeated wc-admin_import_orders tasks, and I appreciate that you’re hesitant to enable HPOS. Could you share a bit more about why you prefer not to turn on HPOS? Enabling HPOS can help optimise order management and may be a key part of resolving this issue.
Also, to help rule out external factors, could you let us know if you have completed a conflict test by switching to the Storefront theme and deactivating all other plugins except WooCommerce? Our guide on how to test for conflicts explains the process: https://woocommerce.com/document/how-to-test-for-conflicts. This step can help determine whether another plugin or theme might be causing the import tasks to persist.
It would be very helpful if you could generate a System Status Report from WooCommerce > Status > Get system report and share it via pastebin.com or quickforget.com. You can follow the steps in this guide: https://woocommerce.com/document/understanding-the-woocommerce-system-status-report/.
Additionally, please review the scheduled actions in WooCommerce > Status > Scheduled Actions to see if there are any stuck or failed actions related to imports. This article explains how to manage scheduled actions: https://woocommerce.com/document/understanding-the-woocommerce-system-status-report/scheduled-actions/. Once you provide the SSR and let us know about the conflict test and your thoughts on HPOS, we’ll continue to investigate and help get this sorted.
Hello,
Your reply sound like AI generated reply. Can we have a human reply?
Can you explain why enabling HPOS could fix this issue as it’s part of the WC core system?
Thanks
-
This reply was modified 3 months ago by
bvedgie.
Hi @bvedgie,
Thanks for your patience, and fair question.
To answer it directly: HPOS is being mentioned because Analytics relies on different data sources depending on whether HPOS is enabled. Without HPOS, Analytics depends on multiple legacy lookup tables to decide if an order is fully synced. If even one related row is missing or inconsistent,
wc-admin_import_orderswill keep re-queuing the order, even when the action itself shows as complete.With HPOS enabled, Analytics reads from a single, dedicated order table and can reliably determine that an order is already imported, which is why this loop often stops once HPOS is on.
That said, HPOS is not mandatory. If you prefer not to enable it, the next practical step would be to inspect one affected order and confirm whether all related Analytics lookup tables (order stats, product lookup, tax lookup, customer lookup) contain matching data. A mismatch there would explain the repeated imports.
Let us know how you’d like to proceed.
It’s been a while since we heard back from you for this reason we are closing this thread.
If WooCommerce has been useful for your store and you appreciate the support you’ve received, we’d truly appreciate it if you could leave us a quick review here:
https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post
Feel free to open a new forum topic if you run into any other problem.
The issue remains.
Hi there!
Thank you for your patience, To help us narrow down the cause:- Do you have any plugins that interact with orders installed on your site?
- Are there any external systems or integrations that sync with your store?
From what you’ve described, the fact that the same specific orders (from 2022–2023) keep being re-imported suggests that something is specifically acting on those orders, rather than random ones.
Also, have you tried enabling HPOS? We suggest this because enabling HPOS can help prevent issues like this because:
- Orders are stored in a dedicated
wp_wc_orderstable, instead ofwp_posts. - Metadata updates are more isolated, reducing the chance of unintended changes.
- The
date_updated_gmtcolumn is only modified by actual WooCommerce order operations, not generic WordPress post updates.
Once we know more about your plugins or external integrations, we can provide a more targeted solution to stop these repeated imports.
Hello shahzeen,
- Nothing specific. Please see the status report. We tried disabling AutomateWoo and others with no luck.
- No as we don’t trust that.
- We’re not ready to move on HPOS system. We have tools to adapt according to HPOS. This will be for later and it does not seem appropriate to ignore the current problem by changing the system.
Thanks for your help. Regards
- Previous imports failed partially, leaving the action in a
You must be logged in to reply to this topic.