I recently worked on a site that needed some modifications carried out, the client wanted a more effective way of adding galleries

As I always do before I start modifying a WordPress website, I take a full backup just in case. My go to tool for this job is InfiniteWP which does a great job of taking backups to remote storage, Google Drive in my case.

Unfortunately on this occasion, InfiniteWP timed out. I figured it was because the client had a lot of image uploads as I’ve worked on some of their other sites and have seen the same.

Luckily for me UpdraftPlus was already installed which did a good job of ‘chunking’ the uploads folder into split zip files. Backup complete. But there was an notice in the UpdraftPlus status page which read

“Warning: WordPress has a number (16) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working. Read this page for a guide to possible causes and how to fix it.”

There is a link to UpdraftPlus support articles which goes on to explain that there are various reasons this could happen. After some digging and looking at how wp-cron actually worked, it occurred that the web host this particular website was on, Heart Internet, had disabled what’s called “loopback” requests which is the method WordPress uses to run scheduled tasks.

Normally WordPress checks it’s database to see the last time cron ran and if it needs to, calls the file wp-cron.php to start scheduled tasks. There is a work around which involves adding a line to your wp-config.php file below. What this does is uses a connection when a visitor comes to the site by redirecting them immediately. The old connection they had is then used for wp-cron.php.

define('ALTERNATE_WP_CRON', true);

Full explanation from the WordPress developers can be found here.