Wordpress- how to disable plugin update

Disable plugin update

Add this code in your plugin root file.

add_filter('site_transient_update_plugins', 'remove_update_notification');
function remove_update_notification($value) {
     unset($value->response[ plugin_basename(__FILE__) ]);
     return $value;
} 

Put this code in the theme functions.php file. This is working for me and I'm using it. Also this is for specific plugin. Here you need to change plugin main file url to match to that of your plugin.

 function my_filter_plugin_updates( $value ) {
   if( isset( $value->response['facebook-comments-plugin/facebook-comments.php'] ) ) {        
      unset( $value->response['facebook-comments-plugin/facebook-comments.php'] );
    }
    return $value;
 }
 add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

Here:

"facebook-comments-plugin" => facebook comments plugin folder name

"facebook-comments.php" => plugin main file.this may be different like index.php

Hope this would be help.


In the plugin file, there will be a function that will check for updates. The original author could have named this anything, so you will have to go through the code and check each function and what it does. I would imagine the function will be quite obvious as to what it does.

Alternatively you can add this to your plugin file:

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;
}

Credits: http://developersmind.com/2010/06/12/preventing-wordpress-from-checking-for-updates-for-a-plugin/