22

Is there any way to disable a module and its dependents modules with Drush.

Let's say I need to disable views but I have enable views_accordion as well.

If I run $ drush pm-disable views I don't get the views module disable.

2 Answers 2

31

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

drush dis views
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
0

In Drupal 8 we can uninstall the module with the following command:

drush pm:uninstall oauth2

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 that you have read and understand our privacy policy and code of conduct.

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