Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress - Disable specific plugin update check
<?php
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
$pluginsToDisable = [
'plugin-folder/plugin.php',
'plugin-folder2/plugin2.php'
];
if ( isset($value) && is_object($value) ) {
foreach ($pluginsToDisable as $plugin) {
if ( isset( $value->response[$plugin] ) ) {
unset( $value->response[$plugin] );
}
}
}
return $value;
}
add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' );
@cliffordp

This comment has been minimized.

Copy link

@cliffordp cliffordp commented May 29, 2019

Plugin to do this for files with version control: https://github.com/cliffordp/tk-exclude-vcs-updates

@jonathannz

This comment has been minimized.

Copy link

@jonathannz jonathannz commented Apr 17, 2020

Thanks. This works great.
Is there a relatively easy way to have some text display next to plug-ins (for which updates are disabled), indicating they are disabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.