Magento 2 – Disable All Modules of a Particular Vendor

magento-2.1magento2module

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 ?

Best Answer

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.

Related Topic