Run WP-Cron From a Real Cron Job
Stops WordPress from checking for scheduled tasks on every page view; you trigger wp-cron.php from your server's cron instead, which is faster and more reliable.
Opens WPIDE on
Code
// After enabling, add a server cron job, for example every 5 minutes:
// */5 * * * * curl -s https://example.com/wp-cron.php?doing_wp_cron > /dev/null
if ( ! defined( 'DISABLE_WP_CRON' ) ) {
define( 'DISABLE_WP_CRON', true );
}
Notes
Without the server cron job, scheduled posts, backups and emails stop running.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.