5

I am stuck with a crappy vendor whose extensions have lot of bugs.

I want to disable all the extensions from that vendor for sometime, without deleting the inside settings, to check if some other problems are caused by this extension or not.

How can I disable all extension from a vendor in shortest possible way?

3 Answers 3

17

You can try something like this, this is one-liner command. And it will find & disable all modules except which one start with Magento_

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

To disable all module for particular vendor, you could use something like this

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

The differences is one with grep -v Magento and the other is grep VendorName_ :)

7
  • yes, I was looking for something like this. will check soon and let you know.
    – kashish
    Aug 31, 2017 at 7:14
  • Yes, it does what you say. But I want to disable extensions that starts with vendorname_. Not except vendorname_
    – kashish
    Aug 31, 2017 at 7:44
  • @kashish Change Magento in previous command to VendorName. That's just an example, you can do anything you want :) Aug 31, 2017 at 8:32
  • you didn't understand my previous comment. I mean I want to disable all the extensions that starts with vendorname_, not disable all the extensions that starts except vendorname_
    – kashish
    Aug 31, 2017 at 8:51
  • @kashish Please check my updated answer :) Aug 31, 2017 at 11:30
1

Try this from command bash:

Go to your Magento root directory and run this command:

php bin/magento module:disable Vendor_Module1 Vendor_Module2 ..

Add this at the end of command to clear modules static contents:

--clear-static-content

Note: you can see the list of all modules by:

php bin/magento module:status

3
  • I know this will work, but there are about 30 extensions. Typing all of them will take lot of time. I think there must be a shorter way.
    – kashish
    Aug 31, 2017 at 6:46
  • btw, when I enable the extensions later, will the settings of extensions be still there or will it be removed?
    – kashish
    Aug 31, 2017 at 6:48
  • 1
    Extension's setting is saved in Database so it will not be removed. Aug 31, 2017 at 6:50
0

You can easily disable all your extension from app>etc>config.php

In this file you can find

<?php
return array (
  'modules' => 
  array (
    'NAMESPACE_MODULENAME' => 1,
    'Magento_Store' => 1    
...............................    
  ),
);

Where 1 is enable and 0 means disable the extension. So just find the your custom modules from this file and set it 0. and run rest of the magento commands like, di:compile, cache:flush, static-content:deploy.


Note: this is for debugging purpose, we should always use `command line

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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