General

How can I Uninstall and Remove a Magento 2 Extension

Hello Magento Friends,

Today I will be mentioning a much-needed topic for all the Magento 2 merchants. How can I Uninstall and Remove a Magento 2 Extension?

Quick Summary:

Extensions help to add functionalities to your Magento 2 store apart from the default settings. Installing Magento 2 extensions facilitates enhancing store performance. Different extension holds different operational capabilities. Thus, there is a number of extensions installed in your Magento 2 store. Make sure the extensions are compatible with the latest version Magento 2.4.

A time may arise where you need to uninstall the extension due to any reason. Too many extensions affect the performance of the store, so you want to uninstall the unwanted extensions. Also, when you find two or more extensions that have similar features, you want to uninstall one from it. The other reason may include, the extensions that are no longer needed in your store needs to be removed.

Hence, for the smooth performance of your Magento 2 website, completely remove or uninstall the not required extensions. One can Uninstall or Remove a Magento 2 Extension in two ways – Manually and Using Composer. Let’s see both the ways in detail 

Steps to Uninstall or Remove a Magento 2 Extension – Manually

Step 1:  Firstly you have to check the extensions you need to uninstall. So, connect through SSH to the root of your Magento installation folder and check the list of all extensions installed with the help of the following command.

php bin/magento module:status

Step 2: Now, for uninstalling the extension disable that extension module with the help of the below commands.

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

php bin/magento setup:upgrade

Step 3: Remove the extension using the below code.

cd app/code/<ExtensionProvider>/ 

rm -rf <ExtensionName

Step 4: Run the following code after the completion of the above step.

php bin/magento setup:upgrade

Illustration: By the following illustration code of uninstalling my module you will get a clear idea about the steps to uninstall the extension.

php bin/magento module:disable Magecomp_Paymentfee --clear-static-content

php bin/magento setup:upgrade

cd app/code/Magecomp 

rm -rf Paymentfee

php bin/magento setup:upgrade

Steps to Uninstall or Remove a Magento 2 Extension – Using Composer

Step 1: Firstly you have to check the extensions you need to uninstall. So, connect through SSH to the root of your Magento installation folder and check the list of all extensions installed with the help of the following command.

php bin/magento module:status

Step 2: Now, for uninstalling the extension disable that extension module with the help of the given below commands. Just apply to your system by filling in the appropriate details.

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

php bin/magento setup:upgrade

– ExtensionProvider and ExtensionName it will be viewed from the composer.json file of that extension.

– For the name of VendorName and VendorExtension, you will get in your composer.json file which is included with that extension.

Illustration: By the following illustration code of uninstalling my module you will get a clear idea about the steps to uninstall the extension.

php bin/magento module:disable Magecomp_Paymentfee --clear-static-content

composer remove magecomp/magento-2-payment-fee

php bin/magento setup:upgrade

Note: For the composer method you might need to enter a username and password while uninstalling the module.

Final Words:

Hence, this way you can remove or uninstall a Magento 2 extension. In case you face any difficulties, let me know through the comment section below. Help your Magento friends to successfully remove or uninstall a Magento 2 extension by sharing the article with them. Stay connected for more such Magento solutions.

Happy Reading.

Click to rate this post!
[Total: 8 Average: 5]
Gaurav Jain

Gaurav Jain is Co-Founder and Adobe Certified Expert-Magento Commerce Business Practitioner. Being Computer Engineer?‍? and possessing Extensive Marketing skills he handles all kinds of customer Queries and his Happy? & Helping? Nature makes customer's day Delightful. When he isn’t working, you’ll find Gaurav Reading on Books? or Traveling?. Also, he is Speaker at Magento Meetups.

Recent Posts

How to Add Tooltip in Checkout Shipping Field in Magento 2?

Hello Magento Friends, In today’s blog, I will explain How to Add Tooltip in Checkout…

22 hours ago

How to Integrate and Use MongoDB with Laravel?

MongoDB is a popular NoSQL database that offers flexibility and scalability when handling modern web…

2 days ago

NodeJS | Callback Function

In NodeJS, callbacks empower developers to execute asynchronous operations like reading files, handling requests, and…

3 days ago

How to Show SKU in Order Summary in Magento 2?

Hello Magento Friends, In today’s blog, we will learn How to Show SKU in Order…

5 days ago

Best Colors to Use for CTA Buttons

The "Buy Now" and "Add to Cart" buttons serve as the primary call-to-action (CTA) elements…

7 days ago

Magento 2: How to Save Custom Field Value to quote_address for Multi-Shipping Orders

Hello Magento Friends, In Magento 2, the checkout process allows customers to choose multiple shipping…

1 week ago