Use Linux Cron to Trigger WordPress Cron Scheduler

Ever ran into a situation where your scheduled post does not publish or a scheduled backup does not happen in time? Makes you want to talk to the host, does not it? But before you do so, make sure that your problem site does not suffer from extremely low traffic. If there are just a handful of visitors coming to your site daily, this is the root of the problem. WordPRess and its plugins schedule tasks with a pseudo-cron service that does not work the same way as the real cron on Linux. WordPress needs someone to actually visit the web site to trigger a cron; Linux cron always run on time no matter what.

The problem got really annoying when I worked on a staging server with next to no traffic but still need regular backups. For a while I resorted to backing up files and databases manually, and it was far from ideal.

Luckily, I came across a great solution to the WordPress cron problem posted by Ryann on the Pogidude Studio blog. All you have to do is create a real cron job that simulates a visitor thus triggering the WordPress cron process. Ryann’s example is for cPanel but will work for any type of a control panel as long as your host allows you create cron jobs. WordPress’ own cron process will need to be disabled so it does not trigger itself with real visitors.