This article shows how to disable WordPress cron jobs by deactivating cron jobs in the wp-config.php file and adding them to by run directly through crond every 6 hours.
Disabling WP-CRON and using a manual cron job helps to ensure that cron job tasks are run regularly, in cases where a site receives little traffic, and can also improve performance on sites with a lot of traffic by allowing the cron job to run during low-traffic hours.
Disable WordPress Cron Jobs
- Log into the appropriate cPanel
- Navigate to the File Manager, located in the Filessection
- Access the document root of the site
- Edit the wp-config.php file in the document root
- Locate the following line, usually between lines 35 to 40
/** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', '');
- Below that line, add this line
define('DISABLE_WP_CRON', true);
- Save the file
- In the cPanel, navigate to Cron Jobs, located in the Advanced section
- Add this cron job to occur every six hours
- Set Hour: to Every Sixth Hour (*/6)
- Set Minute: to :00 (At the beginning of the hour.) (0)
- Set all other time options to *
- Enter the following command into Command
/usr/local/bin/php -q /home/userna5/public_html/wp-cron.php
REPLACE: Be sure to replace /home/userna5/public_html with the actual document root.
-
Click Add New Cron Job
EXAMPLE: