Skip to content

Instantly share code, notes, and snippets.

@JeffAspen
Created October 8, 2017 03:37
Show Gist options
  • Save JeffAspen/b9a3f16d263ee1a0ac8c8860a8b5a528 to your computer and use it in GitHub Desktop.
Save JeffAspen/b9a3f16d263ee1a0ac8c8860a8b5a528 to your computer and use it in GitHub Desktop.
Prevent WordPress plugins from requesting updates
/*
* https://ben.lobaugh.net/blog/202432/prevent-wordpress-plugins-from-requesting-updates
* Be sure to change [plugin_folder]/[plugin_file].php to the plugin you want to prevent updating.
*/
add_filter( 'site_transient_update_plugins', array( 'no_updates_for_you' ) );
function no_updates_for_you( $value ) {
$plugin = '[plugin_folder]/[plugin_file].php';
if ( empty( $value ) || empty( $value->response[$plugin] ) ) {
return $value;
}
unset( $value->response[$plugin] );
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment