I have been noticing a lot lately that my scheduled WordPress.org blog posts are not getting posted. I’ll go check on them, and they will say “Missed Schedule”. The date and time are correct on them, so I know that should have gone live. Why is this happening, and what can I do? It’s hard, because sometimes my posts MUST go up on time. Thanks!
So I’m going to talk about two separate things here: cron jobs, and WP-Cron.
A cron job is kind of like a timer on the server. You set it up to go off at a certain time, then when the timer goes off, the server performs a specific action. So if you were to think about it in terms of scheduling posts, it would work like this:
You schedule a post for January 1st, 2014 at 3pm. You have the cron job set up to run every 30 minutes. So every 30 minutes it checks to see, “Does anything need to be done?” It checks at 2:30, and nothing needs to be done because there are no posts scheduled. Then it checks again at 3:00, and it sees that a post needs to be published, so it completes that action.
However, this is NOT the system that WordPress uses.
Why WordPress doesn’t use cron jobs.
WordPress doesn’t use “real” cron jobs because in order to set them up, you have to configure things on your server, and WordPress doesn’t have direct access to that. It’s something you have to set up manually. So instead, WordPress has created a workaround called WP-Cron.
WP-Cron gets loaded at the start of every page load. It checks to see if it’s supposed to publish anything, and if so, then it publishes it. However, since WP-Cron gets activated on page loads, it ONLY works when the page gets loaded.
If no one visits your site when a post is scheduled to be published, the WP-Cron doesn’t load and the post doesn’t publish.
Here’s an example…
Let’s say you schedule a post for January 1st, 2014 at 3:00 pm. But in this example, no one visits your blog at all between 1pm and 5pm on that day. Then, WP-Cron never gets loaded, because your site got zero page loads at 3pm, when your post was supposed to be scheduled. If WP-Cron never gets loaded, then it can’t publish the post. This can result in a “Missed Schedule”.
A real cron job, however, runs on time regardless of whether there are page loads or not. That’s why it’s a superior solution.
But you can set up WordPress to use real cron jobs instead!
The best solution is to change your WordPress installation to use real cron jobs instead of the WP-Cron alternative. Here’s a great guide you can follow: Using a Real WordPress Cron Job for Increased Reliability. This is what I’ve done on my own site, and I highly recommend it.
Alternatively, you could try installing this plugin: WP Missed Schedule Fix Failed Future Posts. Setting up a real cron job is a much better solution, but if you can’t (or really don’t want to) do it for some reason, give this plugin a try. I’ve never used it, so I can’t vouch for it, but it might be a decent solution.