WordPress uses "WP-Cron" for scheduled tasks like publishing scheduled posts, sending emails, and running plugin maintenance. This guide explains how WP-Cron works and how to replace it with a real server cron for reliability.
How WP-Cron Works
WP-Cron triggers scheduled tasks only when a visitor loads a page. On low-traffic sites, scheduled tasks may run late or not at all. On high-traffic sites, WP-Cron may fire too frequently, adding load.
Disabling WP-Cron
In wp-config.php, add:
define('DISABLE_WP_CRON', true);This prevents WP-Cron from running on page loads.
Setting Up a Real Cron Job
In cPanel, go to Advanced > Cron Jobs. Add a new cron job running every 5β15 minutes:
*/15 * * * * /usr/local/bin/php /home/username/public_html/wp-cron.php > /dev/null 2>&1Replace username with your cPanel username and the path to your WordPress root.