How to Replace the Wordpress Cron Job in cPanel
Replacing the WordPress Cron is one of the easiest things you can do to speed up your website, especially for new visitors. The Wordpress Cron has processes to run at regular intervals (Hourly, Daily, Monthly). However, by default the checks for these jobs are triggered by visits to your website.
This means that when someone visits your site not only does your Wordpress website have to generate the page, it also has to complete any tasks it has missed. This can result in slow load times for that customer.
This process can be improved by creating automated cron jobs to occasionally trigger these automated checks.
Step 1 - Log into cPanel and click on
File Manager.
Step 2 - Navigate to your document root (usually the public_html folder) and find your
wp-config.php file.
Right click (or Command+click on a mac) and click
Edit.
Step 3 - Under the line which starts with "define('WP_DEBUG", type this:
define('DISABLE_WP_CRON', true);
Make sure you click
Save Changes in the top right, then close the page.
Step 4 - From the main page of cPanel, click on the
Cron Jobs icon.
Step 5 - Add a New Cron Job.
Minute:
0
Hour:
Every Sixth Hour
Day/Month/Weekday:
Leave as default
Command: Type the below (make sure to replace yourdomain.net.au with your domain name):
wget -q -O - https://yourdomain.net.au/wp-cron.php?doing_wp_cron > /dev/null 2>&1
Once that's done, click
Add New Cron Job.
Notes:
Ensure you set the 'Minute' field correctly. If you set this to *, the Cron job will run every minute and cause high load on your cPanel. On Shared servers, Crons cannot be set to run more frequently than every 5 minutes.
On Shared servers, since many users set Crons to run at the start of every hour, you may wish to set yours to run at minute '45' or another time so that they complete faster.
For more tutorials on website development and Wordpress troubleshooting, view ourList of Wordpress Guides.