Disabling the Update Feature for WordPress Plugins

(Updated 5/11)
Every now and then a WordPress plugin is close but not quite what you need. In the (usually not recommended) event that you have to hack a plugin’s logic, you’ll probably want to disable the update feature for that plugin so no one can upgrade and overwrite your changes. I take no credit for writing this code as it is taken completely from htmlgraphic.com. (I like to keep archives just in case)

// prevent update notifications to avoid overwriting customizations

add_filter( ‘http_request_args’, ‘dm_prevent_update_check’, 10, 2 );
function dm_prevent_update_check( $r, $url ) {
if ( 0 === strpos( $url, ‘http://api.wordpress.org/plugins/update-check/’ ) ) {
$my_plugin = plugin_basename( __FILE__ );
$plugins = unserialize( $r[‘body’][‘plugins’] );
unset( $plugins->plugins[$my_plugin] );
unset( $plugins->active[array_search( $my_plugin, $plugins->active )] );
$r[‘body’][‘plugins’] = serialize( $plugins );
return $r;

If you’re plugins are already showing update notifications add this to /wp-includes/update.php, refresh the plugins page and remove this afterward.

get_site_transient( ‘update_plugins’ ); // unset the plugin
set_site_transient( ‘update_plugins’, ” ); // reset plugin database information

If you’ve hacked the WordPress core you may want to check out this plugin to disable updating of WP itself.