Spawn WP-Cron Less Often
Lets WordPress start its background task runner at most every five minutes instead of every minute, reducing extra requests on busy sites.
Opens WPIDE on
Code
// Minimum seconds between two WP-Cron runs.
if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) {
define( 'WP_CRON_LOCK_TIMEOUT', 5 * MINUTE_IN_SECONDS );
}
Notes
Scheduled tasks can run up to five minutes late.
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.