Is there a way to remove specific plugins and themes from showing up from the WordPress Updates page?
1 Answer
There are two hooks you can use: 'site_transient_update_plugins', and 'site_transient_update_themes'.
Plugins
To disable update for 'fpw-category-thumbnails' plugin, put the following code in functions.php of your theme ( child theme ):
function remove_plugin_updates($value) {
unset($value->response['fpw-category-thumbnails/fpw-category-thumbnails.php']);
return $value;
}
add_filter('site_transient_update_plugins', 'remove_plugin_updates');
If you want to disable updates for all plugins, use the following code:
function remove_plugin_updates($value) {
return null;
}
add_filter('site_transient_update_plugins', 'remove_plugin_updates');
Themes
To disable update for 'twentytwelve' theme, put the following code in functions.php of your theme ( child theme ):
function remove_theme_updates($value) {
unset($value->response['twentytwelve']);
return $value;
}
add_filter('site_transient_update_themes', 'remove_theme_updates');
If you want to disable updates for all themes, use the following code:
function remove_theme_updates($value) {
return null;
}
add_filter('site_transient_update_themes', 'remove_theme_updates');
Summary
To disable plugin's update, you must know a path to plugin's .php file, relative to '/wp-content/plugins/' folder.
To disable themes's update, you must know a path to theme's folder, relative to '/wp-content/themes/' folder.
Easy way
To make it all easy, use Easy Update Manager plugin.
-
Thanks for such a detailed answer. If the Easy Update Manager does the same thing as those filters, I was just testing it out and it does remove it from the Updates page but it also completely disables the ability to update the selected items. Are the notifications of updating plugins (Updates page) tied directly to the ability of updating them? Or is there a way just to disable their display in the Updates page?– TannerCommented Aug 4, 2018 at 16:13
-
Both, filters, and the plugin will allow you to disable update info, and ability to update a plugin / theme. You can turn it on and off, when you want it. It is much easier to do it with the plugin, because you don't need to edit functions.php, for every change. Commented Aug 4, 2018 at 18:21
-
Okay, in order to satisfy my requirement, it sounds like I can just use an if statement based on roles or permissions before listing which plugin to disable.– TannerCommented Aug 7, 2018 at 18:51