8.5.x module.api.php hook_modules_uninstalled($modules)
8.0.x module.api.php hook_modules_uninstalled($modules)
8.1.x module.api.php hook_modules_uninstalled($modules)
8.2.x module.api.php hook_modules_uninstalled($modules)
8.3.x module.api.php hook_modules_uninstalled($modules)
8.4.x module.api.php hook_modules_uninstalled($modules)
8.6.x module.api.php hook_modules_uninstalled($modules)
7.x system.api.php hook_modules_uninstalled($modules)

Perform necessary actions after modules are uninstalled.

This function differs from hook_uninstall() in that it gives all other modules a chance to perform actions when a module is uninstalled, whereas hook_uninstall() is only called on the module actually being uninstalled.

It is recommended that you implement this hook if your module stores data that may have been set by other modules.


$modules: An array of the modules that were uninstalled.

See also



Related topics

6 functions implement hook_modules_uninstalled()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

block_modules_uninstalled in modules/block/block.module
Implements hook_modules_uninstalled().
module_test_modules_uninstalled in modules/simpletest/tests/module_test.module
Implements hook_modules_uninstalled().
node_modules_uninstalled in modules/node/node.module
Implements hook_modules_uninstalled().
rdf_modules_uninstalled in modules/rdf/rdf.module
Implements hook_modules_uninstalled().
system_test_modules_uninstalled in modules/simpletest/tests/system_test.module
Implements hook_modules_uninstalled().

... See full list

1 invocation of hook_modules_uninstalled()
drupal_uninstall_modules in includes/install.inc
Uninstalls a given list of disabled modules.


modules/system/system.api.php, line 2738
Hooks provided by Drupal core and the System module.


function hook_modules_uninstalled($modules) {
  foreach ($modules as $module) {
      ->condition('module', $module)


bucefal91’s picture

Just in case somebody wonders, I'll clarify it here that this hook implementation belongs to your .module file and not to .install (I had to investigate it at least, as it did not seem clear from the hook documentation).