Magento 2 Developement

How to disable module in Magento 2

There are 3 ways to disable module in Magento 2. Well, actually 3rd way only disable module output, but it can be done directly from admin.
Disable module via command line
Disable module manually
Disable module output
Uninstall module completely

Disable module via command line

Magento 2 has powerful build-in command line tool to perform various tasks. To disable module in ssh console type

Some modules in magento depends on other modules. In this case you get a warning with a list of dependent modules

You can still disable the module in this case with help of [-f|--force] flag. Be aware that your store might not function properly in this case!!!

Complete list of module commands commands are:

Disable module manually

You can disable module in Magento 2 manually. Open /app/etc/config.php. It could look like

To disable module you need to set its value to 0.
'Nwdthemes_ArraySerialized' => 1, >>> 'Nwdthemes_ArraySerialized' => 0,.
This method is not recommended to use since config.php generated automatically during setup:upgrade routine.

Disable module output

You can disable module output in magento admin. This is suitable if you pretty sure that error comes from one of module blocks and you do not have access to ssh console. However, in this case module still active and if it has any events / plugins etc they still will be executed.

Navigate to Stores > Configuration > Advanced > Disable module output. Scroll to module, select “Disable” in dropdown next to module name and click “Save Config”. Last step is to clear / flush store cache.

Uninstall module completely

If you want to uninstall module completely – check our Magento 2: How to uninstall module tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *