24

Is there any way to disable a module and the modules which depend on it with Drush?

Let's say I need to disable the Views module, but I enabled the Views Accordion module as well. If I run drush pm-disable views, it does not disable the Views module.

2 Answers 2

31

You should update your Drush by the sounds of things. Doing drush dis views should result in the following:

The following extensions will be disabled: views, views_bulk_operations, og_ui, views_content, og_example, views_php, views_ui
Do you really want to continue? (y/n)

Which means the dependents are disabled at the same time.

3
  • 3
    Note that this doesn't work for pm-uninstall. instead, you will need to take the list of modules, pass it to pm-uninstall and repeat that command until all modules are uninstalled.
    – Berdir
    Jun 13, 2012 at 13:14
  • 1
    Yep, I often find myself just going to the actual uninstall page for uninstalling.
    – 7wonders
    Jun 13, 2012 at 13:16
  • You are right, maybe I did a typo on the method.
    – chefnelone
    Jun 13, 2012 at 13:27
2

In Drupal 8, we can uninstall a module with drush pm:uninstall oauth2, for example.

1
  • 1
    Note that this not just disables the module. It will uninstall it, and remove all settings and corresponding tables in the database. In drupal 8 you can not disable modules anymore. See the answer here: drupal.stackexchange.com/questions/268976/…
    – Rick B
    Mar 3, 2020 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.