11

Is there is any way that we can disable all custom and third party Module in a single command? Currently, I am using below command to disable multiple modules

php bin/magento module:disable module1 module2 module3....moduleN

Currently I am defining all module but I don't want to define all modules since there are so many modules.

T P T
  • 51
  • 9
akgola
  • 2,927
  • 1
  • 26
  • 57

3 Answers3

29
php bin/magento module:status | grep -v Magento | grep -v List | grep -v None | grep -v -e '^$'| xargs php bin/magento module:disable

Credit : Toan Nguyen

Source

Keyur Shah
  • 18,046
  • 6
  • 66
  • 80
4

You can simply disable what modules you want by modify in app/etc/config.php file the value form 1 to 0 for the specific module. and the run php bin/magento setup:upgrade command.

Example:

'Ves_Setup' => 1, 

changed:

'Ves_Setup' => 0, 
Alin Lupoiu
  • 2,662
  • 5
  • 40
  • 76
1

You can use below command to enable disable modules by specific company name.

For example:-

For enable all below modules in single command

  1. Vendor_Module1
  2. Vendor_Module2
  3. Vendor_Module3
  4. Vendor_Module4
  5. Vendor_Module5
  6. Vendor_Module6
  7. Vendor_Module8
  8. Vendor_Module9
  9. Vendor_Module10

Run below command in your Magento setup.

php bin/magento module:enable $(php bin/magento module:status | grep '^Vendor_' | grep -v '^List|^None|^Magento|^$'| xargs)

For Disabled all above modules in single command

php bin/magento module:disable $(php bin/magento module:status | grep '^Vendor_' | grep -v '^List|^None|^Magento|^$'| xargs)
Mohammad Bharmal
  • 594
  • 3
  • 14