How to uninstall and remove a Magento 2 extension

0
28

A. Manual Uninstall

Step 1: Connect via SSH to the root of your magento installation (this is the folder that has the app folder in it) and check the list of all modules including their enable / disable status

  • php bin/magento module:status

Step 2:  Disable the module by executing below commands:

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

Step 3: Remove extension files

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

!Note: If you are using more extensions from the same provider make sure not to remove the shared extension, most providers use a shared extension or dependancy pack as a base for all their extensions.

 

Example: Let assume you are using WeltPixel OWL Carousel Extension and you want to uninstall it and remove all associated files:

  • php bin/magento module:disable WeltPixel_OwlCarouselSlider –clear-static-content
  • php bin/magento setup:upgrade
  • cd app/code/WeltPixel/
  • rm -rf OwlCarouselSlider

 

Important: If you are using other WeltPixel extensions make sure not to remove the ‘Backend’ shared extension as it is used by the rest of WeltPixel installed extensions. If you do not have any other WeltPixel extensions it is safe to uninstall and remove also the ‘Backend’ extension.

B. Composer Uninstall

Step 1: Connect via SSH to the root of your magento installation (this is the folder that has the app folder in it) and check the list of all modules including their enable / disable status

  • php bin/magento module:status

 

Step 2: Disable the module by executing below commands::

  • php bin/magento module:disable <ExtensionProvider_ExtensionName> –clear-static-content
  • php bin/magento setup:upgrade
  • composer remove VendorName/VendorExtensionRepository

Note: you can find the exact match for ExtensionProvider and ExtensionName in composer.json file associated with the extension.

Note2: you can find the exact match for VendorName and VendorExtension in composer.json file associated with the extension.or under yourmagentoinstallation/com/vendor/<VendorName>/<VendorExtension>

Note3: You may be asked for composer username and password when uninstalling, you will be able to find them under var/composer_home/auth.json

 

Example: Let assume you are using WeltPixel OWL Carousel Extension and you want to uninstall it and remove all associated files. First thing you should disable this extension, run the setup upgrade and finally remove the files via composer:

  • php bin/magento module:disable WeltPixel_OwlCarouselSlider –clear-static-content
  • composer remove weltpixel/m2-weltpixel-owl-carousel-slider
  • php bin/magento setup:upgrade

 

Important: If you are using other WeltPixel extensions make sure not to remove the ‘Backend’ shared extension as it is used by the rest of WeltPixel installed extensions. If you do not have any other WeltPixel extensions it is safe to uninstall and remove also the ‘Backend’ extension.