How to Uninstall or Remove an extension in Magento 2

The Most Popular Extension Builder for Magento 2

With a big catalog of 234+ extensions for your online store

On the marketplace, there are various extensions built for Magento 2 stores. There is no denying that powerful extensions bring many benefits for eCommerce stores. Especially after installing Magento 2 for your online store, you will normally install many different modules with different functions on your website.

However, as your website grows, you realize that some of the modules are not suitable for your store, or the module functions are no longer meeting the requirements for your website, it’s time for you to uninstall and remove some extensions on Magento 2 stores.

Moreover, when your Magento 2 store has a large number of extensions, it may cause some bad consequences for the website, such as increasing the page load time, taking up a large amount of memory, occurring conflicts between extensions, affecting store performance, etc. For those reasons, uninstalling and removing the extension in Magento 2 is a must-have.

This article will explain to you in detail How to uninstall and remove a Magento 2 extension. Keep reading until the end because it’s so worth it for you.

Without further ado, let’s dig into it!

Table of Contents

How to uninstall & remove a Magento 2 extension

Uninstalling a module is a simple task that does not require too many complicated steps. Today we will suggest 2 methods to uninstall and remove a Magento 2 extension.

  • Manually uninstall
  • Using Composer

Method 1: Uninstall and Remove a Magento 2 Extension Manually

Step 1: Connect via SSH to the root of Magento installation

First of all, you must check the extensions that you want to uninstall. Then, connect via SSH to the root of your Magento installation folder (this folder contains the app folder) and run the following command to check the list of all extensions:

php bin/magento module:status

Step 2: Disable the extension

Next step, you need to disable the extension that you want to uninstall by using the commands below:

php bin/magento module:disable <ExtensionProvider_ExtensionName> --clear-static-content
php bin/magento setup:upgrade

Step 3: Remove the extension

Using the following code to remove extension files:

cd app/code/<ExtensionProvider>/
rm -rf <ExtensionName>

Note:

Please remember that if you are using multiple extensions from one vendor, you are most likely risking deleting the shared module that serves as the basis for all modules from the vendor. So, make sure the extension is not shared.

Step 4: Refresh your website homepage

Last but not least, you need to refresh the website’s home page. Congratulations! Yoủ Magento 2 uninstall extension process is successful.

For example:

Suppose you are using Magento 2 One Step Checkout Extension by Mageplaza, and you want to uninstall and remove it. The following illustration will help you to have a clear look at how to uninstall and remove this module.

php bin/magento module:disable Mageplaza_OneStepCheckout --clear-static-content
php bin/magento setup:upgrade
cd app/code/Mageplaza/
rm -rf OneStepCheckout

Method 2: Uninstall and Remove a Magento 2 Extension Using Composer

Step 1: Connect to the root of Magento installation via SSH

First of all, you must check the extensions that you want to uninstall. Then, connect via SSH to the root of your Magento installation folder (this folder contains the app folder) and run the following command to check the list of all extensions:

php bin/magento module:status

Step 2: Disable the extension

Next step, you need to disable the extension that you want to uninstall by using the commands below:

php bin/magento module:disable <ExtensionProvider_ExtensionName> --clear-static-content
php bin/magento setup:upgrade

Step 3: Remove the extension using composer remove command

By running the composer remove statement, you can remove the extension you want. composer remove VendorName/VendorExtensionRepository

Note:

  • ExtensionPRovider and ExtensionName will be found in the composer.json file of that extension or under yourmagentoinstallation/com/vendor/<VendorName>/<VendorExtension>
  • Usernam and password can be found under var/composer_home/auth.json

Final words

Uninstalling and removing a Magento 2 extension is a task you should definitely do if you own a Magento store. We suggest 2 simple ways; you can choose one of them. However, we recommend that you uninstall and remove a module via composer to get the best result. This method also does not cause major errors for your website.

In case you run into any difficulty, don’t hesitate to let us know by commenting below. We are also very grateful if you share this helpful article with your friends.

Thanks a lot for reading, and we’ll see you in the next post.

Looking for
Customization & Development Services?

8+ years of experiences in e-commerce & Magento has prepared us for any challenges, so that we can lead you to your success.

Get free consultant
development service

Explore Our Products:

Subscribe

Stay in the know

Get special offers on the latest news from Mageplaza.

Earn $10 in reward now!

Earn $10 in reward now!

comment
iphone
go up