How To Disable / Enable Module in Magento 2.x

There are two ways to enable / disable module

[1] By Using CLI Command, here disabled Module Magento_TwoFactorAuth

php bin/magento module:status 
php bin/magento module:disable Magento_TwoFactorAuth
php bin/magento setup:upgrade
php bin/magento cache:flush

[2] By Using Magento Root /app/etc/config.php

<?php
return [
    'modules' => [
        'Magento_AdminAnalytics' => 1,
        'Magento_Store' => 1,
        'Magento_AdobeIms' => 1,
        'Magento_AdobeImsApi' => 1,
        'Magento_AdobeStockAdminUi' => 1,
        'Magento_MediaGallery' => 1,
        'Magento_AdobeStockAssetApi' => 1,
        'Magento_AdobeStockClient' => 1,
        'Magento_AdobeStockClientApi' => 1,
        'Magento_AdobeStockImage' => 1,
        'Magento_Directory' => 1,
        'Magento_AdobeStockImageApi' => 1,
        'Magento_AdvancedPricingImportExport' => 1,
        'Magento_Theme' => 1,
        'Magento_Amqp' => 1,
        'Magento_AmqpStore' => 1,
        'Magento_Config' => 1,
        'Magento_Backend' => 1,
        'Magento_Authorization' => 1,
        'Magento_Eav' => 1,
    ]
];

To Disable any Module, convert 1 into 0 & run below command



php bin/magento setup:upgrade
php bin/magento cache:flush

3 thoughts on “How To Disable / Enable Module in Magento 2.x

  1. Thanks for the marvelous posting! I actually enjoyed reading it, you
    might be a great author.I will make sure to bookmark your blog and
    will eventually come back in the future. I want to encourage that you continue your great job, have a nice day!

  2. I love what you guys tend to be up too. This kind of clever work and exposure!
    Keep up the very good works guys I’ve included you guys to my personal blogroll.

Leave a Reply

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