WordPress is doing a lot in the background. On a very expensive server you would have these tasks scheduled, but that’s not how most web servers work. They can only run code when someone, or something (a robot) accesses a page. Sometimes, if your site is not getting visitors, the queue of tasks is horrendous and takes far too long to get through.

This is basic checks such as updating your theme, updating plugins and updating WordPress itself. If a visitor opens a web page and your site decides now is the time to download the latest version of WordPress they could be there a while. And if it doesn’t complete because they get fed up and look elsewhere it will try for the next user and the next user… Here are a few steps to take to sort this problem.

Disable the ‘Cron’ – this is the fake scheduling tool.

This is the automated check in the background that runs when a visitor opens a page. On your file server open wp-config.php and add these lines towards the end:

/* Disable the Cron on every page load */
define( ‘DISABLE_WP_CRON’, true );

IMPORTANT! Don’t add this to the very end – it won’t work. Look for this comment and add it ABOVE this line:

/* That’s all, stop editing! Happy blogging. */

Replace the Cron

Without the Cron your site is open to vulnerabilities as it will get out of date. Very simple to fix and even improve. Sign up to cron-job.org (free) and simply add a new Cron Job that runs every 15 minutes to call:

[your website]/wp-cron.php?doing_wp_cron

Keep Waking The Site

If you keep ‘poking’ the site it won’t fall asleep, if that’s the problem. And again it’s automated and very useful. Sign up at pulsetic.com (again free) and simply add a monitor to your homepage. The advantage here is that the you now have a monitor on your site and Pulsetic will warn you when your SSL is expiring, if your website crashes etc. Because you can set the monitor to fire every 5 minutes the site doesn’t get time to go to sleep and should the cron be accidentally re-enabled then Pulsetic should make sure the home is called frequently enough to keep those background tasks refreshed.

Three very simple steps and I’ve seen these fix the problem of a WordPress site that gives the server error when it appears to have drifted off to sleep. It’s usually fine on the second load, but not the first. The above should fix it.