Magento Disable Module

3 Best Solutions Magento Disable Module with Detailed Examples

by Juvia

Whether you’re looking to Magento disable module guide, you end your eyes right place here. Managing your Magento store efficiently involves not only adding new functionalities but also strategically disabling modules that may no longer serve your needs. The process of disabling modules is crucial for maintaining a streamlined and optimized e-commerce platform. In this article from our Magento tutorial for beginners series, we’ll provide detailed examples to disable extensions temporarily.

How to Disable Module in Magento 2

During the usage of extensions for your store, sometimes admins need to disable Magento modules temporarily due to conflicts or temporary errors. There are several ways to temporarily disable your extensions, and in this section, we will introduce you to the three simplest methods: Web Setup Wizard, Command line, and Configuration Extension.

Let’s dive in!

Solution 1: Magento 2 Disable Extension via Web Setup Wizard

This is the easiest solution to disable Module Magento 2 and this seems convenient for non-developer users. However, this way does not actually disable your extension but rather disables the display block output defined or outputted by the module.

If there are no blocks used by the module, this option is useless. Let’s take an example: “If your module called directly from the template, you disable module output, the module still works”

By navigating in the Magento Backend to Stores => Configuration and find the module you want to disable

store configuration

In the General Configuration section, click Enable and set No

magento-disable-module

After that, click “Save Config”, flush your cache and the module is “disabled”.

save config to disable Magento module

 

Solution 2: Magento Disable Module through the Command line

Step 1: Navigate to Your Magento 2 Root Directory

Once you are logged in to your server, navigate to the root directory of your Magento 2 installation.

Step 2: Disable Magento Module

To disable any installed module, run:

bin/magento module:disable VendorName_ModuleName

Replace VendorName_ModuleName with the actual name of the vendor module and the module you want to disable. For example, if the module is named Bss_PreOrder, the command would be:

bin/magento module:disable Bss_PreOrder

Come to think of Magento disabling the module, another problem occurs when you don’t clear static view content. This may bring issues such as there are various files with a similar name and you don’t clear all of them.

On the other hand, due to static file fallback rules, assume that you don’t clear static files and have more than one file with the same name, but different content, and fallback rules will make the static view display incorrectly. To everything work well, make sure that [-c] or [–clear-static-content] is added to the command line.

bin/magento module:disable [-c|--clear-static-content] [-f|--force] [--all] <module-list>

Step 3: Update the Database

Run this command line to upgrade your database

bin/magento setup:upgrade

Step 4: Clear all Cache

bin/magento cache:clean

Solution 3: Disable Magento 2 Extension by Configuration Extension

Many extension providers include the enable/disable functionality in the module’s configuration.

Example: Navigate to Store => Configuration, find the vendor, select the extension, Enable / Disable it, and refresh the cache.

magento-2-disable-extension

Note: The module remains active, but functions return to the initial value.

Magento 2 Disable Module: FAQs

Why do you need to disable a module?

There are a number of reasons you should disable a module: The number of modules on your store is too much and is affecting your site performance, or it could simply be that you do not need to use the Magento extension at the present time, but intend to use them later. In these cases, disabling the modules proves to be an effective solution to keep the site up to speed.

What are the prerequisites needed to disable a module?

There are no prerequisites needed for the command to disable a module.

How to disable/enable modules that depend on each other?

Magento allows you to enable and disable any module available, both Magento-provided and third-party custom modules. For certain modules that are dependent on another module, you have to disable the module they depend on first. In addition, there can be modules that are conflicting and can’t be enabled at the same time.

For example:

If module B is dependent on module A, you can’t disable module B until after you have disabled module A.

In case both of them are disabled, you should enable module B first then you can enable module A.

When modules A & B are conflicting, you can disable one of the two modules, but you can’t enable them at the same time.

Dependencies are declared in the required field in Magento’s composer.json file for each module. Conflicts are declared in the conflict field in modules’ composer.json files. We use that information to build a dependency graph: A->B means module A depends on module B.

A dependency chain is a path from one module to another one. Example A->B->C

To solve this, we need to use the [-f] (force) flag in the command line

magento module:disable [-c|--clear-static-content] [-f|--force] [--all] <module-list>

Conclusion

Disabling unnecessary extensions in the Magento store can greatly enhance your store’s performance and user experience. This will make your site fast, secure, and optimized for your needs. There are many ways to Magento disable module.  Choose one, and follow the steps above to ensure a smooth process. Remember to test your site after making changes and keep backups for safety. Regularly reviewing and managing your extensions will help maintain a streamlined and efficient Magento store.

Looking to optimize your Magento site speed? Our specialized Magento speed optimization service can help enhance your store’s performance, reduce loading times, and improve user experience. Our team of experts focuses on fine-tuning your site to ensure it runs smoothly, increasing customer satisfaction and boosting conversions. Contact us today to discover how we can elevate your Magento store to new levels of efficiency and speed.

If you are looking for other guides to Install or Uninstall Magento Extension. Read more:

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.