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.

wpcron01.png


Step 2 - Navigate to your document root (usually the public_html folder) and find your wp-config.php file.

wpcron02.png

Right click (or Command+click on a mac) and click Edit.

wpcron03.png


Step 3 - Under the line which starts with "define('WP_DEBUG", type this:

define('DISABLE_WP_CRON', true);

wpcron05.png


Make sure you click Save Changes in the top right, then close the page.

wpcron06.png


Step 4 - From the main page of cPanel, click on the Cron Jobs icon.

wpcron08.png


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.


ac2d0ac0529936067c3db763b1998869e99df95c?t=78b2e244913a9bdceb74c6f2778762c9
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.


Did you find this article useful?