Occasionally, when a post is added to a WordPress blog, it is scheduled for a future date and time. Or someone may use one of the dozens of plugins that adds multiple posts at one and schedules them for you.
Usually, this scheduling works. Sometimes it fails. And, when it does fail it can be very frustrating. Don’t worry, there is a way to fix it.
Before understanding the solution, let’s understand the problem a bit better.
Scheduled posts are handled internally by WordPress using the WP-Cron script (wp-cron.php). WP-Cron is “fired” whenever the site is opened, by humans or robots, and it’s responsibility is to check the scheduler and publish anything it finds that needs publishing after the current date/time.
WP-Cron is not “real” cron.
Unfortunately, this does not always work. It could be because of server issues, or conflict with another plugin, or a myriad of other possibilities. After a certain number of these failures (I really don’t know what WP’s criteria is for this), the post is considered “missed”, and subsequently ignored. Kind of a bummer, right?
I know of two ways to fix this.
Using “Real” Cron in WordPress
The first options is to completely disabled WP-Cron and do it yourself. To do this, first you have to add the following line to your wp-config.php file (preferably after the database declarations, or even at the bottom of the config file):
Now that WP-Cron is turned off, you need to control it yourself, either using an internal cron job that is set up in your control panel (CP), or via an external cron service (like http://www.setcronjob.com – I pay a paltry $10 per year for this great service!).
To set up an internal cron job, you’ll have to log into your control panel, and determine the frequency you’ll want it to run (keeping in mind, of course, that it will use resources). The job you set up will look something like this:
cd /home/hosting-user-name/public_html/sub-directory; php -q wp-cron.php
(note: you may not have a sub-directory)
Some hosts differ in their setup. Check with them if you need help, or see if they have a manual to follow.
Using an external cron like http://www.setcronjob.com is much simpler. You will set it up like this:
The big problem with using this technique is that it happens all at once. Let’s say you’ve decided it should run once every 3 hours. All of the posts scheduled prior to that time will all be processed at that time. So, even if the post was supposed to be published two hours prior, it will still appear to the ping services and the search engines to be published at the time the cron runs. The date and time become essentially meaningless.
Plugins to the Rescue
The second method is really far better, and “forces” WP-Cron to work as was intended. It does add a bit of plugin overhead to the opening of a site, but it’s probably minimal most of the time. You can install one of two plugins
Missed Schedule, which may or may not be current (although I am still using it)
WP Missed Schedule, which may or may not be derived from the plugin listed above.
Both plugins work the same way. When a page on your site opens, the plugin checks for “missed schedule” posts and publishes them. WP Missed Schedule will re-post 10 at a time – one each minute – until all missed posts have been posted – not sure about the details of the other plugin. Keeping the plugin active for the future will prevent missed posts without adding to regular overhead.
Since the first plugin does not seem as current, I guess I would grab the 2nd plugin (although I have not used it, and therefore, cannot give it my recommendation – yet).
The plugin option seems like the best solution all around.
- 10 Must-Have Free WordPress Plugins to Improve Your Workflow(wplift.com)
- Create cron job in Magento(techbandhu.wordpress.com)
- Beware: WordPress alert(computerweekly.com)