How to prevent Drupal from checking for updates on a contrib module

Drupal Version
7

Sometime you may not want a contributed module that is installed in your Drupal site to be checked for updates. Perhaps you need to remain at a particular version for stability or compatibility reasons. Or, perhaps you've had to result to hacking the module to add your own custom code. Normally, Drupal will check all installed modules automatically, or manually, depending on your settings and, if an update is available, it will be listed on your Available Updates screen with access to quickly update the module automatically. This could be bad if you don't want your module to be updated.

Thankfully there is a quick and easy solution to disable the checking of specific modules during Drupal's update check. Simply use the hook_update_projects_alter() function (api docs).

Example usage:

<?php
 
function YOUR_MODULE_update_projects_alter(&$projects){
    unset(
$projects['WYSIWYG']); // Use the project name of the module to disable update checking on.
}
?>

Simply use the hook_update_projects_alter() hook in your own custom module and unset the $projects variable where the array key equals the project name of the module you want to disable update checking on.

Author Information

Written by: Shawn Ostermann

Shawn is a Drupal Specialists with over 12 years of experiencing building and developing Drupal websites including custom module development and e-commerce websites.