49

Is there a way to disable update notifications for specific plugins?

As a plugin developer, I have some plugins installed on my personal site using the svn trunk version for testing, but the same plugins are available from the plugin site. In these cases WP considers the latest version to be the most recently published version and constantly tries to warn me that updates are available.

I still want to see notifications for updates on other plugins, but it's anoying to constantly ignore the Updates (2) notice in the header!

  • Simply open up the plugin file and change the version number to something like 9.9.9 – Bainternet Jun 21 '11 at 14:53
  • Sorry @Bainternet but that would have been too hackish because the site is an svn-checkout and the plugin comes from an svn:external reference to the plugin development code. Having a locally modified file on a production server is not an option. Hameedullah's filter works because it gets saved in the code repository for the site. – Caleb Jun 21 '11 at 15:22
  • Yeah i missed the part about the site running on svn – Bainternet Jun 21 '11 at 16:26
  • You can also just use the Disable Updates Manager plugin by Websiteguy on WordPress.org. – matthew May 30 '14 at 19:03
65

For example if you don't want Wordpress to show update notifications for akismet, you will do it like:

function filter_plugin_updates( $value ) {
    unset( $value->response['akismet/akismet.php'] );
    return $value;
}
add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );
  • 1
    I placed that at the end of ./wp-config.php, replaced the plugin file path and it did the job. – Caleb Jun 21 '11 at 15:20
  • 5
    You can put that in your theme's functions.php if not possible then you can put in a separate plugin file. In my view putting this into wp-config.php is not a good idea. – Hameedullah Khan Jun 21 '11 at 17:07
  • 1
    I don't really want my function tied to the theme, and adding a plugin seems like as much of a hack as just hacking the plugin I've got. Can you explain why you think wp-config.php is not a good place to put site specific configuration hacks? – Caleb Jun 22 '11 at 13:20
  • Very good solution, which worked fine for me in functions.php. It is easy to add more plugins to the list simply by adding another unset()... Good tip Hameedullah.. – Lars Koudal Nov 13 '11 at 10:28
  • 2
    For those with the same remarks as @Caleb, create in the wp-content folder a new folder named: mu-plugins and create a little plugin which you drop inthere. To add it as mentioned above by some in the wp-config.php is imho absolutely the wrong place to do. – Charles Oct 6 '16 at 13:34
30

Hameedullah Khan's answer will throw a PHP warning. Include this if clause to check to make sure it's an object before unsetting the response for that plugin.

'Warning: Attempt to modify property of non-object'

Try this to avoid the warnings (code for the plugin file itself):

// remove update notice for forked plugins
function remove_update_notifications($value) {

    if ( isset( $value ) && is_object( $value ) ) {
        unset( $value->response[ plugin_basename(__FILE__) ] );
    }

    return $value;
}
add_filter( 'site_transient_update_plugins', 'remove_update_notifications' );

I like to put this in the actual plugin. Since I've only ever disabled updates on a plugin because I've edited or forked the code and don't want to lose my edits on an update, I've already edited the plugin and thus don't mind editing it more. It keeps my functions file a bit cleaner. But if you wish you can put it in the functions file and a benefit to that method is you can remove multiple plugins from updates by adding another unset line for that plugin like so (code for functions.php):

// remove update notice for forked plugins
function remove_update_notifications( $value ) {

    if ( isset( $value ) && is_object( $value ) ) {
        unset( $value->response[ 'hello.php' ] );
        unset( $value->response[ 'akismet/akismet.php' ] );
    }

    return $value;
}
add_filter( 'site_transient_update_plugins', 'remove_update_notifications' );
  • Thx for this. I had issues using this code directly within plugins, seemed ok when it was one plugin but as soon as I did it with others (diff func names) I lost notifications for all plugins and the "view details" link for wp-repo plugins also disappeared. Using your checks but placing in my theme's functions.php has been more reliable without interference of update notifications for other plugins. Lastly, not being in the plugin has the benefit of not needing that plugin to be active for it to work. Disabling a plugin with this code will obviously present update notifications again. – Philip Ingram Apr 4 at 1:38
2

Disable All Update Notifications with Code

function remove_core_updates(){
        global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
    }
    add_filter('pre_site_transient_update_core','remove_core_updates');
    add_filter('pre_site_transient_update_plugins','remove_core_updates');
    add_filter('pre_site_transient_update_themes','remove_core_updates');

Code will disable update notifications for the WordPress core, plugins, and themes.

  • "individual plugins" is the key – Gangesh Jul 18 at 10:30
  • @Gangesh, I think he wants to disable some specific plugin's notifications – Super Model Jul 18 at 13:20

protected by fuxia Mar 27 '15 at 22:15

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.