Disable plugin update notification for a specific plugin in WordPress 3.1

Just  quick sniplet of code to drop into a plugin file to disable plugin update notifications.

The reason i’ve written this is a plugin which has been heavily modified has a update, and, wanted to stop hearing about it; Sure, I could’ve just changed the name, but this felt more Politically Correct (and isn’t that what we’re all supposed to do!?)

So, The code:

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

Have fun, and happy Hacking!

29 Replies to “Disable plugin update notification for a specific plugin in WordPress 3.1”

  1. oh thanks! such a timely post. exactly what i looked for on the first google search result! i am having a good day!. thanks again!

  2. Hello, it seems like a simple solution blocking pluin update notifications. Question: Where exactly do I drop the above mentioned code? In its own little file that I put in the main directory of the plugin itself? Please advise. Thank you.

  3. Steve

    just copy and paste that code in the main .php file of the plugin in question, I don’t think location matters as long as it is within PHP tags.

  4. Works great for a single plugin per WP site — but adding it to a second plugin throws an error: Fatal error: Cannot redeclare dd_remove_update_nag().

  5. ‘Duh, of course; quickly found a workaround for multiple plugins — just use different function and filter names for each plugin, e.g.:
    add_filter(‘site_transient_update_plugins’, ‘dd_remove_update_nag2’);
    function dd_remove_update_nag2($value) {
    unset($value->response[ plugin_basename(__FILE__) ]);
    return $value;
    }

    Thx for the nice solution to the update nag issue!

  6. Thanks so much for this, works absolutely perfectly, just what I needed for a custom facebook wall feed plugin (heavily modified) for a client site.

  7. Thanks for the nice little snippet! I have a plugin on a few sites that was working perfectly, but the updates simply kept breaking all the time. With this I am now shot of the little reminders that make the dashboard look unwashed…

  8. It works great, but I get a PHP warning, clogging my PHP error log:
    Attempt to modify property of non-object on line XX

    line XX: unset($value->response[ plugin_basename(__FILE__) ]);

  9. @Jossi: You can solve this by doing this:

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

  10. Cool snippet. But I think your suggestion to rename the plugin is actually more politically correct. You could just rename it to “Plugin name – modified” or something. This will even prevent you to accidentally update the plugin in the future.

  11. Hi,
    thanks for the snippet!

    can i change “plugin_basename(__FILE__)” into the slug
    for the specific plugin value i find in the database options-table:
    option_name: _transient_plugin_slugs

    In that case i can have multiple ‘removes’:

    add_filter('site_transient_update_plugins', 'dd_remove_update_nag');

    function dd_remove_update_nag($value) {

    unset($value->response['members-list/init.php']);

    unset($value->response['subscribe-to-comments-reloaded/subscribe-to-comments-reloaded.php']);

    unset($value->response['wp-user-frontend/wpuf.php']);

    return $value;
    }

    Not sure if this will work, since i dont have any update-notifications.

Comments are closed.