On this page
Uninstalling Modules
This documentation needs work. See "Help improve this page" in the sidebar.
In order to uninstall the module, be sure that the module is not being used on your site so that it does not impact any functionality. The full process will require 2 steps: uninstall and remove your module folder.
You can use either the Drush or the Administrative Interface to uninstall modules.
Using Drush
Pre-requisite: Drush should be installed on your machine.
To install Drush check How to install Drush.
Run the following Drush command to uninstall the module:
drush pm-uninstall module_name
Or use the Drush alias:
drush pmu module_name
Next, clear cache using the Drush command:
drush cr
That's it. The uninstalled module will no longer show as checked in the module list and the functionality of the module will have been removed from the site.
Using the Administrative Interface
- In the Manage administrative menu, navigate to Extend > Uninstall tab
(admin/modules/uninstall)where you will find the list of enabled modules that are ready to be uninstalled. - You can search or filter for the module to be uninstalled by typing the module name in the search field.
- Check the box/boxes of modules that you want to uninstall.
- Click the Uninstall button at the bottom of the page.
- Step 4 will prompt you to confirm the module uninstall request.
- Click Uninstall.
- Go to the link
manage>configuration>development>performanceclick onclear all cache.
The functionality of the uninstalled module will now have been removed from the site. If you are sure you wont need the module any more you can remove the module folder from your server. This can be done on different ways depending on your set up. Most commonly can be done with composer or manually; make sure you don't have composer manager and look for you hosting provider instructions for manually removing files.
Using composer
Having uninstalled the module, you can then remove the module code from your server using composer. Be sure to uninstall via the admin interface or by using Drush before removing the codebase.
Run composer remove drupal/module
References to this module in composer.json and composer.lock should be removed, as well as the folder in the directory path (e.g. in /modules/contrib/)
Verify in /admin/modules/ module had been removed (it should not show the module available for install.)
If for some reason, module folder gets retained in the /modules/contrib directory, you may now safely delete it now, e.g. running rm -rf module_name from that directory
Run the usual update.php, drush updb, drush cache:rebuild, etc. to clean-up and flush system
In case you are working on a workflow with more than one environment (including you local) you should consider uninstall your module in production before you remove it from composer. Otherwise you may not be able to uninstall and you will end up with errors on your database. Refer to https://www.drupal.org/docs/administering-a-drupal-site/configuration-management/managing-your-sites-configuration
Refer also to https://www.drupal.org/forum/support/post-installation/2022-03-04/uninstall-modules-that-were-installed-with-composer
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.