8.3.x module.api.php hook_uninstall()
8.0.x module.api.php hook_uninstall()
8.1.x module.api.php hook_uninstall()
8.2.x module.api.php hook_uninstall()
8.4.x module.api.php hook_uninstall()
5.x install.php hook_uninstall()
6.x install.php hook_uninstall()
7.x system.api.php hook_uninstall()

Remove any information that the module sets.

The information that the module should remove includes:

  • Variables that the module has set using variable_set().
  • Modifications to existing tables.
  • Database tables the module created.

The uninstall hook must be implemented in the module's .install file. It will fire when the module gets uninstalled.

Related topics

19 functions implement hook_uninstall()

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

aggregator_uninstall in modules/aggregator/aggregator.install
Implementation of hook_uninstall().
blogapi_uninstall in modules/blogapi/blogapi.install
Implementation of hook_uninstall().
book_uninstall in modules/book/book.install
Implementation of hook_uninstall().
contact_uninstall in modules/contact/contact.install
Implementation of hook_uninstall().
dblog_uninstall in modules/dblog/dblog.install
Implementation of hook_uninstall().

... See full list

2 invocations of hook_uninstall()
drupal_uninstall_module in includes/install.inc
Calls the uninstall function and updates the system table for a given module.
system_modules_uninstall in modules/system/system.admin.inc
Builds a form of currently disabled modules.

File

developer/hooks/install.php, line 325
Documentation for the installation and update system.

Code

function hook_uninstall() {
  drupal_uninstall_schema('upload');
  variable_del('upload_file_types');
}

Comments

globalabhishek’s picture

Hi,
I have created my own custom moduel. I am creating default view during installation of module. The thing is working properly.

But I want to delete my custom created view during un-installation of my custom module. But I am unable to do so.

Can anybody help me.

Abhishek
globalabhishek@gmail.com