Skip to content

Speed Up WordPress Using Page Caching and Cron

WP Super Cache has been my go-to caching plugin for the longest time. Its interface is simple, and the combination of its expert mode—bypassing PHP altogether on cached pages—and preloading function speeds up WordPress sites a lot.

Replace WP-Cron by an Actual Cron Job

Avoiding WP-Cron calls on random page loads by setting up a real Linux cron job isn’t hard. The first step involves editing wp-config.php by adding the following line:

define('DISABLE_WP_CRON', true);

Then, via SSH or a server control panel like cPanel, add a cron task that runs every 10 or 15 minutes, like so:

curl https://mysite.com/wp-cron.php > /dev/null 2>&1

Update: if your website’s using Cloudflare, you may find cURL requests like the one above result in a 500 Server Error or similar. The command I now suggest is the following:

/usr/local/bin/php /absolute/path/to/your/wp-cron.php > /dev/null 2>&1

If that doesn’t work, you may want to ask your host about the exact server location of the PHP executable.

Calling wp-cron.php like this every 10 to 15 minutes minutes again helps save some actual visitors a little extra time.

Recommended Reading