WordPress has a built-in cron task scheduler known as wp-cron. This cron scheduler can be used to perform various tasks at predetermined intervals, such as creating scheduled backups, publishing scheduled posts, checking for updates, and running plugin tasks. However, wp-cron can sometimes cause performance issues, especially on high-traffic websites. However, there is a way to disable wp-cron and activate external cron jobs.

In this article, we’ll walk through the steps required to disable WordPress cron and activate external cron jobs.
Contents
Identify the Current WordPress Cron Job System
Before we can start disabling wp-cron and activating external cron jobs, we need to determine which system is currently in use. There are two possibilities here:
- Linux Cron is a system-level task scheduler that runs on the server itself. It can run tasks at specific times or intervals.
- cPanel Cron: This is a task scheduler built into the cPanel hosting control panel. It can run tasks at specific times or intervals.
If you’re unsure which system your hosting provider uses, you can contact them and ask.
Disable wp-cron Job
Once you know which cron system is used, the next step is to disable wp-cron. To do this, you need to add the following line of code to your wp-config.php file:
define('DISABLE_WP_CRON', true);
This code tells WordPress not to run the wp-cron automatically. Once you’ve added this code, you must set up an external cron job to run the wp-cron.php file regularly.
Set Up an External Cron Job
To set up an external cron job, you’ll need to use either Linux Cron or cPanel Cron, depending on which system your hosting provider uses. Here are the steps for each system:
Linux Cron:
- Log in to your server using SSH.
- Run the following command to open the crontab editor:
One of the critical tasks in running a website is to ensure that you have a backup of your data in case of any data loss or corruption. WP Staging is a popular plugin for creating staging environments on WordPress websites. It also provides a backup feature that allows you to schedule backups of your website data.
In this article, we will guide you through disabling the normal WordPress wp-cron jobs and using an external cron for the backup plugin WP Staging and all other plugins that rely on cron jobs.
crontab -e
- Add the following line of code to the crontab file:
*/15 * * * * /usr/bin/php /path/to/your/wordpress/installation/wp-cron.php > /dev/null 2>&1
This code tells the system to run the wp-cron.php file every 15 minutes. Make sure to replace “/path/to/your/wordpress/installation/” with the path to your WordPress installation.
- Save and close the crontab file.
cPanel Cron:
- Log in to cPanel and go to the Cron Jobs section.
- Click on the “Add New Cron Job” button.
- In the “Command” field, add the following code:
/usr/bin/php /home/username/public_html/wp-cron.php
Make sure to replace “username” with your actual cPanel username.
- Set the interval to “Every 15 minutes”.
- Click on the “Add Cron Job” button to save the changes.
That’s it! You’ve now disabled wp-cron and set up an external cron job to run the wp-cron.php file regularly.
Conclusion
Disabling wp-cron and activating external cron jobs can help improve the performance of your WordPress website, especially if you have a lot of scheduled tasks. Following the steps outlined in this article, you can easily set up an external cron job and ensure that your scheduled tasks run smoothly. If you have any questions or issues, don’t hesitate to contact your hosting provider for assistance.