How to disable update notification for certain plugins

Sometimes it's a must to disable update notification for certain plugins because you don't want to overwrite the modifications you did before. Maybe it's not a best practice, but this could be the best solution in some cases.

If you customized a plugin, you might want to disable update notifications for the plugin, so you won’t lose your modifications. This is not a best practice, but could be the only solution in some cases.

To disable update notifications, place the following code in functions.php
NOTE: if you are using a child theme, place it in child theme’s functions.php

function wcr_remove_update_notifications($value) {
    // you can specify a list of plugin paths (from wp-content/plugins)
    $plugins = array(
        'akismet/akismet.php'
    );
    
    foreach ($plugins as $key => $plugin) {
        if (empty($value->response[$plugin])) {
            continue;
        }
        
        unset($value->response[$plugin]);
    }
    
    return $value;
}

add_filter('site_transient_update_plugins', 'wcr_remove_update_notifications');

Replace akismet/akismet.php with the path to the plugin you want to disable the notifications for. You can specify as many plugins as you wish.

Leave a Reply

Your email address will not be published. Required fields are marked *