Time matters, and being able to schedule content to be published at the right time can be a very useful feature. WordPress allows us to choose when posts should be published and thats all very good. The problem is that more often than not we hear from people how disappointing and frustrating it was to find out that the articles they had scheduled on their blog were not published at all, and the WordPress backend showed the articles flagged as “missed schedule”.
This problem has been reported by some ENOISE users, and after digging around a bit I realised this error was very widely reported in general. It would appear that this is mainly due to server configuration (firewall in particular) and possibly could also be affected by 3rd party plugins.
It also seems that the file responsible for managing “scheduled tasks” in WordPress (
wp-cron.php) has been criticised by many bloggers. Luckily there are well documented fixes for this problem.
The easy way
Basically, … using a plugin: WP Missed Schedule. More info about this fix can be found here: How to Fix the Missed Schedule Post Error in WordPress.
The better way
Disabling the default “wp-cron” and setting up a proper cron job.
First, wp-cron needs to be disabled in the configuration file:
wp-config.php. You will need to add the following line.
The line above simply sets a named constant (
DISABLE_WP_CRON) to true. You can add this of code just above the following comment (towards the end of the file):
/* That's all, stop editing! Happy blogging. */
Once WordPress’ built-in cron thingy is disabled in your configuration, we need to set up a real cron job to trigger it as a separate process. The command to be scheduled should look something like this:
Note that it should all go in one line. This basically tells the computer to run the script located in
/home/sites/example.com/public_html/wp-cron.php using the
/usr/bin/php56 executable (PHP version 5.6).