Table of Contents
In this article, you will learn how to disabe the WordPress cron job and set an alternative one up via cPanel. By default, the WordPress cron job runs every time someone visits your website which can affect server performance. By configuring this to run in cPanel automatically it can make your website faster as the cron job isn’t running when a visitor first clicks on your website.
How to disable the WordPress cron job (wp-cron.php)
To disable the default virtual WordPress cron job, follow these steps:
- Log in to your cPanel account.
- Search for File Manager then click it.
- Head over to your WordPress installation, Usually public_html.
- Find wp-config.php > right click > edit > edit.
- Scroll down to the bottom and find /* That’s all, stop editing! Happy publishing. */
- Above that line paste the following:
define(‘DISABLE_WP_CRON’, true); - In the top left press save.
- You have now disabled the WordPress cron job file.
How to create a scheduled cron job
To set up a WordPress cron job using cPanel, follow these steps:
- Log in to cPanel.
- Search for cron jobs then click it.
- Scroll down until you see add a new cron job.
- in the Common Settings dropdown box, select Twice an hour.
- In the Command box, paste the following:
${HOME}/public_html; /usr/local/bin/php -q wp-cron.phpYou will need to change “public_html” if your WordPress install is elsewhere. - Click
- The cron job will run every 30 minutes.
Facebook | Twitter | Instagram | LinkedIn | Youtube | Vimeo | Blog | Knowledge Base | Client Area | Google Business