Scheduled action ‘fetch_patterns’ runs every few seconds
-
Hi there,
I noticed something strange in the Scheduled Actions tab.
The ‘fetch_patterns’ action seems to run every few seconds. This has been happening for at least a month now (perhaps even longer). In the last month this action has been fired more than 100.000 times already.
Just a preview from the last few instances:

Also my dashboard is really really slow (pageload sometimes 20s+), I am not sure if this is the reason for that, but it probably doesn’t help either.
I am on WooCommerce 9.8.5 (plugin and db version) and WordPress 6.8.1
-
Hello vbosch,
Thank you for contacting WooCommerce support.
I understand you’re seeing the fetch_patterns action running repeatedly in Scheduled Actions, over 100,000 times in the past month, and you’re also experiencing very slow dashboard performance.
This kind of behavior is unusual and could be contributing to the performance issues. A scheduled action running every few seconds suggests that something may be misconfigured.
To investigate further, could you please share your System Status Report? You can paste it into https://pastebin.com and share the link here.
In the meantime, you can try the following:
– Check WooCommerce > Status > Logs for any related errors.
– Use Query Monitor to identify performance bottlenecks.
– Use WP Crontrol plugin to check for any issues with WP-Cron.Once I have more information, I can help you pinpoint the cause more accurately. Let me know if you have any questions in the meantime.
Looking forward to your response. 🙂
Hi there,
My status report: https://pastebin.com/uXwYZvtH
I’ve emptied the ‘completed’ action scheduler items this morning, so that’s why you don’t see the 100.000+ in the status report.Hey @serafinnyc ,
Thanks for your reply.
I’ve tried the SQL queries in the thread you posted:
To stop the bloat, you can safely delete the stuck
fetch_patternsactions. Here’s the SQL:DELETE FROM wp_actionscheduler_actionsWHERE hook = 'fetch_patterns' AND status = 'pending';After that you’ll clean up the orphan log:
DELETE FROM wp_actionscheduler_logsWHERE action_id NOT IN ( SELECT action_id FROM wp_actionscheduler_actions);The first query deleted 1 row, the second query deleted 321934 rows.
However when I look at the WooCommerce ‘scheduled actions’, it sadly didn’t fix it, the ‘fetch_patterns’ hook still runs every few seconds.I see the final solution in the thread is uninstalling WooCommerce, this is something I’d like to avoid if possible.
Hi there!
Thank you for sharing the system status report.I can see that you’re using multiple plugins that may register custom REST API endpoints or background tasks, which could be related to the repeated
fetch_patternsaction or similar AJAX calls.Since you’ve already cleared all pending requests, I recommend performing a test by deactivating all plugins except WooCommerce to check if the issue persists.
Additionally, I suggest installing the Query Monitor plugin to inspect ongoing AJAX calls and hooks that are firing repeatedly. This tool can help identify which plugin or component is triggering the
fetch_patternsaction.Please let me know if you’re able to identify any specific hook or AJAX call related to
fetch_patternsusing Query Monitor.If you prefer not to test on your live site, you can create a staging site to run the conflict test without affecting your production environment. You can use the following plugin to easily create a staging site:
🔗 WP STAGING – Backup & Staging for WordPressLet me know how it goes or if you need help interpreting the results from Query Monitor.
Hey @vbosch
You’re halfway there. Deleting the action and logs helps clean up, but fetch_patterns is being recreated by WooCommerce because something in the HPOS or pattern syncing is still flagged as incomplete.
To be clear, the fix isn’t uninstalling WooCommerce. That’s just a blunt workaround. What you want to do instead is mark the pattern import as complete manually.
Add this to your functions.php temporarily or run it once via WP-CLI or Code Snippets
add_action('init', function() {
if ( current_user_can('manage_woocommerce') ) {
update_option('woocommerce_blocks_did_fetch_patterns', true);
}
});Then refresh your admin once, and remove that snippet. Please do not add Query Monitor to a site that is overly bloated as advised by support. You may crash your site.
Hey @serafinnyc ,
I’ve included the code to my functions.php and reloaded the admin. (I also disabled caching for this).
Unfortunately, this doesn’t appear to change anything in the Scheduled Actions tab.Hey @vbosch
Alright. If setting
woocommerce_blocks_did_fetch_patternsdidn’t stop it, Woo’s likely also checking for the pattern sync task status. Let’s force WooCommerce to consider it fully done.Add this instead (just once, then remove it after page load)
add_action('init', function() {
if ( current_user_can('manage_woocommerce') ) {
update_option('woocommerce_blocks_did_fetch_patterns', true);
update_option('woocommerce_blocks_patterns_fetched', true);
update_option('woocommerce_blocks_show_pattern_banner', false);
update_option('woocommerce_admin_created_default_patterns', true);
}
});After reloading the admin
1. Go back to Scheduled Actions and manually delete any remaining fetch_patterns entries.
2. If it still comes back, I can show you how to unhook it at the plugin level — but this usually works.Let me know what happens next.
Hey @serafinnyc
Also added this code to my functions and reloaded, but it still doesn’t seem to be fixed.
@vbosch Let’s try deactivating Woo and any of its related extensions. Wait a few, clear cache, then turn them back on. I have other tricks up my sleeve, but since that method ended up working for Paul we might as well try it. I often us an app called Coming Soon to put the site in maintenance mode. If you’re working on a live site then use that or whatever you’re using now.
Hello vbosch,
Thank you for your reply.
Could you please let me know if you had a chance to install the Query Monitor and WP Crontrol plugins? If not, I recommend giving them a try. Once you’ve done that, please share your findings with me.
Looking forward to your response. 🙂
@serafinnyc Thanks, I might try to do that in the late evening so there will be less customers on the shop. I’ll let you know if I get any results.
@doublezed2 in WP Crontrol the ‘fetch_patterns’ hook is not displayed at all. It’s recurrence is also ‘non-repeating’ so it might not be triggered by an actual cron but via another function perhaps?
I’ve had Query monitor installed once before but I don’t really know where to look to be honest.Hi there!
I understand your concern. Once you activate Query Monitor, it will show some data in the top admin bar. As shown in this screenshot: https://go.screenpal.com/watch/cThuQXn6zJa. Hover over that data and look for the option Hooks and Actions, then click on it. After that, search for fetch_patterns and see if you are able to locate which query or action is causing it to fire.
If you are not able to find that hook there, try checking the Scripts tab to see if you can find any related data.
I hope this helps
Scripts-tab doesn’t show anything related.
‘Hooks and actions’ just show this: https://snipboard.io/RfDlNa.jpg
I also found one at ‘Transient Updates’: https://snipboard.io/AdeB0F.jpg
And then I found 4 items in the ‘Database Queries’ tab:
https://snipboard.io/V7SC6X.jpg
https://snipboard.io/OW2UqJ.jpg
https://snipboard.io/PaxqVb.jpgHi @vbosch,
Thank you for providing all those details. I’d like us to take a step back for a clearer view of your setup—apologies for revisiting earlier steps, but it’s important to fully understand things.
I noticed you previously shared the system status report, but it looks like it wasn’t reviewed or the link is no longer accessible. Could you please reshare it by going to WooCommerce > Status > Get system report > Copy for support?
Also, this part is crucial and may have been missed earlier: on the same Status page, click the Logs tab, then open any log labeled as a fatal error or one related to WooCommerce, patterns, or blocks, and share it via Pastebin as well.
Once we have both pieces of information, we’ll be in a better position to compare with similar cases and continue troubleshooting effectively.
The topic ‘Scheduled action ‘fetch_patterns’ runs every few seconds’ is closed to new replies.