If you’ve noticed your website has grown slower over time for no apparent reason, scheduled tasks just may be the hidden reason why.
WordPress scheduled tasks use Cron, a time-based job scheduler in Unix. Stale, not executed Cron jobs may stack up, causing database bloat and slow loading of your website.
The reasons why this may occur are varied. Badly coded plugins, an improperly set up manual Cron job for wp-cron.php, and scheduled tasks left behind after deleting a backup or security plugin are just a few reasons why queued Cron events may stack up on you unexpectedly.
[ Key Takeaways
The article discusses that a slow website can be caused by the accumulation of stale and not executed Cron jobs in WordPress, which is a time-based job scheduler. The problem can be caused by badly coded plugins, an improperly set up manual Cron job, or scheduled tasks left behind after deleting a plugin. The article suggests using a plugin such as FFF Cron Manager, Cron View, or WP CRontrol to check the WordPress Cron list and clear any not executed tasks. ]
What are scheduled events in WordPress?
Scheduled events are tasks like those run by the Disqus plugin; security and backup plugins; and many others.
From the WordPress.org Codex, “Function Reference/wp schedule event“:
Schedules a hook which will be executed by the WordPress actions core on a specific interval, specified by you. The action will trigger when someone visits your WordPress site, if the scheduled time has passed. See the Plugin API for a list of hooks.
Do I have a problem with Cron events?
Luckily we have a plugin (or three) for that. Try any of the below:
If after checking your WordPress Cron list, you find you’ve collected thousands of not executed tasks over time, the solution is relatively easy. Use any of the above plugins or run the MySQL command show below to clear them.
My Cron list is so long I can’t delete them with a plugin, what next?
Watch the “How to Clear Your Pending WordPress Cron Tasks in phpMyAdmin (in 14 seconds)” video below.
After logging into phpMyAdmin, enter the text below as shown in the video above, then click the “Go” button to complete the removal of all current Cron tasks:
UPDATE wp_options SET option_value = '' WHERE option_name = 'cron';
Once I clear all of the Cron tasks from my database then what?
Start by checking your website to verify all is loading. If all goes well, you may notice a snappier WordPress Dashboard and site loading. You’re welcome!
Though be sure to re-check your WordPress Cron list again in 24 hours. If something within your site remains misconfigured and continues to cause scheduled tasks to stack up as they had before, you’ll need to work that issue next to prevent the re-bloating of your database in future.
And Enjoy!
I’ve posted a few related article links below. If you have questions just pick up the phone and call anytime, Jim Walker, The Hack Repair Guy, (619) 479-6637
- How do I reset my WordPress password?
- WordPress Troubleshooting and How to Fix Common Errors
- Protecting WordPress Against Brute Force and Denial of Service Attacks
wp cron event list
wp cron event delete