Skip to content

Instantly share code, notes, and snippets.

@Frique
Last active August 29, 2015 14:23
Show Gist options
  • Save Frique/f124e4f7bb93ba8dd105 to your computer and use it in GitHub Desktop.
Save Frique/f124e4f7bb93ba8dd105 to your computer and use it in GitHub Desktop.
Prevent WP update checking
// Tell WP everything is up to date
add_filter( 'pre_site_transient_update_core', 'le_prevent_update_checks' );
add_filter( 'pre_site_transient_update_plugins', 'le_prevent_update_checks' );
add_filter( 'pre_site_transient_update_themes', 'le_prevent_update_checks' );
function le_prevent_update_checks() {
global $wp_version;
return (object) array(
'last_checked' => time(),
'version_checked' => $wp_version
);
}
@Frique
Copy link
Author

Frique commented Jun 21, 2015

In my local development projects the WP update checks tend to time out and cause admin screens to load slowly. This prevents update checking, but it does mean you should disable it occasionally to receive updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment