How can I disable WordPress plugin updates?

I’ve found a great plugin for WordPress under GPLv2 license and made a lot of changes in source code, plugin does something else now.
I modified author (with original plugin author’s credits), URL, version number (from xxx 1.5 to YYY 1.0).

Everything works great, but when WordPress checks for plugin updates it treats my plugin YYY 1.0 as xxx 1.0 and displays notification about available update.

Read More

My changed plugin YYY 1.0 was installed by copying files from my computer, not from WP repository.

What else do I have to change?

Related posts

Leave a Reply

10 comments

  1. 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;
    } 
    
  2. 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.

  3. The simplest and effective way is to change the version of the plugin which you don’t want to get update.
    For an example
    if I don’t want wptouch to get updated, I open it’s defination file, which is like:

    /*
        Plugin Name: WPtouch Mobile Plugin
        Plugin URI: http://www.wptouch.com/
        Version: 4.0.4
    
    */
    

    Here in the Version change 4.0.4 to 9999
    like:

    /*
        Plugin Name: WPtouch Mobile Plugin
        Plugin URI: http://www.wptouch.com/
        Version: 9999
    
    */
    
  4. 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/

  5. One easy solution was to change the version of plugin in plugin file.
    For example if plugin version is 1.2.1. You can make it like below (100.9.5 something that plugin author will never reach to )

    <?php
    /*
     * Plugin Name:       Your Plugin Name
     * Description:       Plugin description.
     * Version:           100.9.5 
    */
    
  6. Here’s an updated version of Mark Jaquith’s script:

    • WP Updates have switched to HTTPS
    • Unserialize was blocked on my shared hosting
    • This uses json_decode and json_encode instead
    • Credit: Block Plugin Update

    .

    add_filter( 'http_request_args', 'widget_disable_update', 10, 2 );
    
    function widget_disable_update( $r, $url ) {
        if ( 0 === strpos( $url, 'https://api.wordpress.org/plugins/update-check/' ) ) {
            $my_plugin = plugin_basename( __FILE__ );
            $plugins = json_decode( $r['body']['plugins'], true );
            unset( $plugins['plugins'][$my_plugin] );
            unset( $plugins['active'][array_search( $my_plugin, $plugins['active'] )] );
            $r['body']['plugins'] = json_encode( $plugins );
        }
        return $r;
    }
    
  7. Disable plugin updates manually:

    1. Open functions.php file (go to your activated themes folder)
    2. Copy and paste the following code:

    remove_action( 'load-update-core.php', 'wp_update_plugins' );

    add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );

    1. Save changes, and you’re done