Wordpress - Turn Off Auto Update for Single Plugin
you place this in your theme's functions.php
// Disable update notification for individual plugins - see my example of plugin block-spam-by-math-reloaded as to how to use this function
function filter_plugin_updates( $value ) {
unset( $value->response['plugin-folder-name/plugin-file-name.php'] );
return $value;
}
add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );
T31os's answer was right: Increase the version number inside the plugin's main file.. eg. 99.9 ... and also make that same change inside the readme file for good measure(though i don't think that's actually required).. – t31os
While Tara's answer works well, it requires the programmer to enter the path to the main plugin file and it is only functional while that particular theme is enabled. An alternative solution might look like this:
add_filter('site_transient_update_plugins', 'remove_update_notification_1234');
function remove_update_notification_1234($value) {
unset($value->response[ plugin_basename(__FILE__) ]);
return $value;
}
one-line version:
add_filter('site_transient_update_plugins', function ($value) { unset($value->response[ plugin_basename(__FILE__) ]);return $value; });
Place this code at the top of the main .php
file of the plugin you wish to disable. If you plan on using this more than once in your site, change the _1234
in the filter and function name to a different set of random numbers to avoid duplicate function names.
Chances are that if you are disabling updates for a particular plugin, it's because you're editing it for some reason... so adding a few extra lines to that plugin should be viable.