How to Fix WP Cron
Since a lot of my plugins rely on WP Cron, I decided that it is time to publish a complete guide about it, or, to be more specific, a complete guide on how to fix it if it is not working.
For example, if you read my article about order lifecycle hooks, it will be crystal clear to you that it is impossible to sync orders correctly in my order sync plugin without WP Cron (or Action Scheduler – which is usually used when WooCommerce installed).
Ok, let’s dive into it.
How to Find Out that WP Cron is Not Working
First things first, before fixing something we need to make sure that it is really not working. But how can we actually find out that WP Cron is not working on our WordPress website?
Of course, there are different ways to do that, you can even use some plugins for that purpose, but my favorite bulletproof way is to create a scheduled post with a publish date, let’s say, two minutes in the future.
Once this post is created, two minutes from that, we can just visit the Posts > All posts page and refresh it once or twice.

Do you see a “Missed schedule” error message? Congratulations – WP Cron is not working properly on your website.
If you’re using WooCommerce (with its Action Scheduler) it is even easier to find out, because a specific error message most likely is going to be displayed in your WordPress admin:

Now let’s try to fix it!
Are There Any Visitors on Your Site?
That’s actually one moment I really need to highlight here because it doesn’t really prevent WP Cron from working, but it prevents it from working correctly.
If you notice that scheduled tasks, which should be run within a couple of minutes, end up running an hour late, then first of all, may I ask you a question – does anybody visit your site?
Let me explain.
By default, if you’re not using an alternate WP Cron, the scheduled tasks are triggered when a website page is opened. For example, if you create a scheduled task (or a specific plugin creates it) and after that, unless somebody visits your site (or maybe you open an admin area page – it doesn’t matter), the task still will be there in a pending state. It is not an error; that’s just how it works – on every page load WP Cron checks if there are any scheduled tasks that need to be executed right now and executes them.
Is Your Site Protected with Basic Auth with .htpasswd?
Nobody is actually talking about it, but it is probably the first thing you need to check.
Below, you can find tips on how you can make your site’s WP Cron work in case you you need HTTP auth and can not just remove it.
Using WP Cron HTTP Auth plugin
The easiest way to fix it – is to install “WP Cron HTTP Auth” plugin.

Once you install and activate it, all you need to do is go to the plugin settings and provide the credentials.
Excluding wp-cron.php file from HTTP auth protection
Of course, if you have access to your site files, I think it would be much better to exclude the wp-cron.php file from the basic auth protection.
Here are the updates you need to make in your .htaccess file.
# that's your basic auth configuration
AuthName "Ooops, it is protected"
AuthType Basic
AuthUserFile /home/public_html_or_something/.htpasswd
Require valid-user
# let's exclude the wp-cron.php file over here
<Files wp-cron.php>
Order Allow,Deny
Allow from all
Satisfy any
</Files>Is wp-cron.php available?
The thing with standard WP Cron (which is usually disliked by some folks) is that WordPress sends an HTTP request to wp-cron.php in order to run scheduled jobs.
When WordPress can do it? Right, when someone visits your website.
But right now we’re not talking about how perfect or not perfect this implementation is. We’re talking about the thing that wp-cron.php should be available, at least for your own website.

For example, if you go ahead and set CHMOD to 000 for this specific file, then just try to open the file by the direct link your-site-domain/wp-cron.php. Error 500, right? WordPress won’t be able to access it as well, so it will lead to a non-working WP Cron. It is just an example, but I hope you get the point.
DISABLE_WP_CRON
If you’re still reading this, it means that the tips above didn’t help.
Ok, let’s check the value of the DISABLE_WP_CRON constant in your wp-config.php file (you can find it right in your site folder).
Is there a line there?
define( 'DISABLE_WP_CRON', true );If yes, that’s probably the reason and we need to remove it.
Why is it there anyway?
- Probably someone, maybe you previous developer, tried to configure an alternate cron and didn’t succeed. Adding this line to the
wp-config.phpis usually the first step of doing it. - Or maybe some guides over the internet with headings like “Disable WP Cron to improve site performance” seemed appealing to you and now you have forgotten about that.
Ask Your Hosting/Server Support
If the above tips didn’t help, guys, I think the most effective way will be to check it out with your server/hosting support team.
If you think that I forgot to mention something, please let me know in the comments.
Misha Rudrastyh
Hey guys and welcome to my website. For more than 15 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me
Hi Misha, thanks for the post! Could you perhaps add a section on making wp-cron work well (!) in a multisite-setup? I found a few “solutions”, but none of them would scale – e.g. set up server side cron for each subsite (okay, but a lot of manual work) or loop through all subsites in one go (well, if there are 500 subsites, this does not work out) – and so on. Would be interesting in your approach, especially as multisite is a very welcome and steady topic here on your website.
Hey Michael,
Thank you for the idea, I will dive into it when I have a chance!
thank you, Misha! you’ve just saved me a ton of time.
My pleasure :)