Skip to content

Instantly share code, notes, and snippets.

@falexandrou
Created September 18, 2017 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save falexandrou/5e9b0a1fb13afa5fd09068eeb2bf0a2a to your computer and use it in GitHub Desktop.
Save falexandrou/5e9b0a1fb13afa5fd09068eeb2bf0a2a to your computer and use it in GitHub Desktop.
Reduce Database load caused by Jetpack
<?php
// Jetpack custom cron schedule to reduce cron load
// Add it in your site-speicic plugin or the theme's functions.php
add_filter( 'jetpack_sync_incremental_sync_interval', function() { return 'hourly'; } );
add_filter( 'jetpack_sync_full_sync_interval', function() { return 'daily'; } );
add_filter( 'jetpack_sync_listener_should_load', '__return_false' );
add_filter( 'jetpack_sync_sender_should_load', '__return_false' );
add_filter( 'pre_option_jetpack_sync_settings_sync_via_cron', '__return_zero' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment