Short answer: Add define('DISABLE_WP_CRON', true); to wp-config.php, then configure a real Linux cron job in cPanel Cron Jobs executing wp-cron.php every 30 minutes.
Accelerate WordPress page load speeds and eliminate server lag spikes by replacing default page-load WP-Cron with a reliable cPanel background cron job.
Before you start: Back up your site files and database and download the backup to your own computer. How to take a full backup
Quick reference
| Config Directive | define('DISABLE_WP_CRON', true); in wp-config.php |
|---|---|
| cPanel Command | /usr/local/bin/php -q /home/USER/public_html/wp-cron.php >/dev/null 2>&1 |
| Optimal Frequency | Every 15 minutes (*/15 * * * *) |
Steps
- Why Replace WP-Cron? By default, WordPress checks for scheduled tasks every single time a visitor loads a page. On high-traffic sites, this exhausts CloudLinux Entry Processes and CPU. On low-traffic sites, scheduled posts miss their publication windows.
- Disable Default WP-Cron in wp-config.php:
- Open
public_html/wp-config.phpin cPanel File Manager. - Add this line just above /* That's all, stop editing! Happy publishing. */:
define('DISABLE_WP_CRON', true); - Click Save Changes.
- Open
- Create the Background Cron Job in cPanel:
- Go to cPanel > Advanced > Cron Jobs.
- Under Add New Cron Job, set Common Settings to Once every 15 minutes (or
*/15 * * * *). - In the Command field, enter:
/usr/local/bin/php -q /home/YOUR_CPANEL_USER/public_html/wp-cron.php >/dev/null 2>&1 - Click Add New Cron Job.
Disable WordPress WP-Cron Directive via CLI
# Add the disable setting to the config file with WP-CLI
wp config set DISABLE_WP_CRON true --raw --path=/home/USER/public_html
Troubleshooting and tips
- Missed Scheduled Posts: If scheduled posts still show as "Missed Schedule", check that the path to
wp-cron.phphas your correct cPanel username substituted.
Need more help? If you run into an error while following these steps, open a ticket with technical support and our team will look into it. Open a ticket