How to check if wp-cron is working?
First, let’s make sure that wp cron is actually working on your website and if not repair it. We’ll create new post and set it publish date in future (few minutes from now)
If WP CRON works as expected the post you’ve scheduled will be published in few minutes. But shit happens and you may get that “missed schedule” error.
WordPress missed schedule issue fix in 4 ways:
- Check whether your
wp-config.phpincludes the line
define('DISABLE_WP_CRON', true);which disables wp cron as you guess. If yes so remove it. If no move forward.
- Some hosting providers got server settings that won’t work with default wp cron method, that’s where we can try to use alternative mode. First, we need to disable default and then enable alternative one. This lines go in your
define('DISABLE_WP_CRON', true); define('ALTERNATE_WP_CRON', true);
In most cases that’s will solve the missed schedule problem. But if you ain’t lucky today, move forward.
- Here is temprorarily workaround for lazy ass. There are two plugins: the old known WP Missed Schedule which is no longer hosted on wordpress.org but github only and the fresh one WP Missed Schedule Posts which you can get from official repository. Both of them work similar: every now and then (5-10 minutes) it scans your website for posts that have missed their scheduled time and if finds such then it will publish them. As you understand that will cause extra load on your server. May be in some cases such approach can be considered but remember that it’s only temprorarily hot fix.
This is not the way you want to waste your server resources, right? Move to point 4 then.
- Right way: real cron job instead of WP CRON. Usually, when someone pops up on the forum with “wp cron not working! help!” message that’s doesn’t mean that wp cron doesn’t actually work but it works not the way topic starter had expected. Why WP Cron is faux cron job and how to set up real cron instead and get rid of wordpress missed schedule issue right read here.