Replacing WP-Cron with a real cron job
More reliable scheduled tasks and a faster site.
WordPress runs scheduled tasks (publishing scheduled posts, sending emails, store tasks) when someone visits the site. On quiet sites tasks run late; on busy sites it wastes resources. A real cron job is better.
- Add this line to
wp-config.php:
define( 'DISABLE_WP_CRON', true );- In cPanel Cron Jobs, add a job every 15 minutes with this command (replace the domain):
wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1