6

I would like disable all module of a particular vendor in a single command.

I know we have php bin/magento module:disable [Vendor_ModuleName] command but as far as I know it doesnot take wild cards like php bin/magento module:disable Foo_*.

I was wondering if they is way to do this in a single go ?

1 Answer 1

25

Ok so tried out some commands and seems like linux shell piping commands can help with this:

Disable all modules for a particular vendor name:

php bin/magento module:status | grep [VendorName] | grep -v List | grep -v None | grep -v -e '^$' | xargs php bin/magento module:disable -f

Example:

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

Disable all custom modules except Magento's core modules:

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

Hope this helps someone.

2
  • Some support for wildcards would be nice though (and logic)
    – snh_nl
    Commented Apr 26, 2019 at 9:00
  • Don't know why, but when I tried the first command to disable all modules for a particular vendor, it disabled ALL modules and not sure how to restore Magento modules as it throws an error now even with module:status command... M2.3.3
    – Webninja
    Commented Dec 17, 2019 at 15:19

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.