{"id":133,"date":"2018-07-17T11:58:13","date_gmt":"2018-07-17T11:58:13","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2018\/07\/17\/uninstall-and-remove-a-magento-2-extension\/"},"modified":"2025-07-17T10:42:10","modified_gmt":"2025-07-17T05:12:10","slug":"uninstall-and-remove-a-magento-2-extension","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/uninstall-and-remove-a-magento-2-extension\/","title":{"rendered":"How to Uninstall and Remove a Magento 2 Extension"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Once you&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/install-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">install Magento 2<\/a>, usually you require to install&nbsp;<a href=\"https:\/\/meetanshi.com\/magento-2-extensions.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 extensions<\/a>&nbsp;to build a fully functional store. As the time and website grow, you realize that some of the extensions are not best-fit&nbsp;or some forfeit their usefulness or their functionality is no longer required or you require reinstallation, it\u2019s time when you want to&nbsp;<em><strong>uninstall and remove a Magento 2 extension<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moreover, when there are a large number of extensions in\u00a0Magento 2\u00a0store, it affects various factors adversely, although offering its functionality. Such factors are the increase in loading time, conflictions occurring between two extensions, SQL errors due to third-party extensions. Due to these reasons, you may require to uninstall a Magento 2 extension.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, you may want to remove a module that offers the same functionality as an already installed extension.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A large number of extensions also results in the complexity of store structure. Isn\u2019t this enough reason to remove the unwanted extensions? Let\u2019s see how the process can be done.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Uninstalling an extension should be a simple task but not always. They leave behind data in a number of places in the database which occupy unnecessary space and affects the store\u2019s performance. Today, I have come up with 2 methods to uninstall and remove a Magento 2 extension.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The extension uninstallation method depends on its installation process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method 1: Uninstall and Remove a Magento 2 Extension Manually<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:<\/strong>&nbsp;Connect via SSH to the root of your Magento installation (the folder that has the app folder in it)<strong>&nbsp;<\/strong>and<strong>&nbsp;go through<\/strong>&nbsp;the list of all extensions including their enable\/disable status<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento module:status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2:<\/strong>&nbsp; Disable the extension by executing the given commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento module:disable &lt;ExtensionProvider_ExtensionName&gt; --clear-static-content\nphp bin\/magento setup:upgrade<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3:<\/strong>&nbsp;Remove the extension files<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd app\/code\/&lt;ExtensionProvider&gt;\/\nrm -rf &lt;ExtensionName&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong>&nbsp;Don\u2019t make the mistake to remove the shared extension from a common vendor. You may end up deleting the dependency pack that serves&nbsp;as a base for all their extensions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong>&nbsp;Suppose you are using Magento 2 Flat Rate Shipping Extension by Meetanshi and you want to uninstall it&nbsp;and remove all associated files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento module:disable Meetanshi_Flatshipping --clear-static-content\nphp bin\/magento setup:upgrade\ncd app\/code\/Meetanshi\/\nrm -rf Flatshipping<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Method 2: Composer Uninstallation Method<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:&nbsp;<\/strong>Connect via SSH to the root of your Magento installation (the folder that has the app folder in it)<strong>&nbsp;<\/strong>and<strong>&nbsp;<\/strong>check the list of all modules including their enable\/disable status<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento module:status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2:<\/strong>&nbsp;Disable the module by executing the given commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento module:disable &lt;ExtensionProvider_ExtensionName&gt; --clear-static-content\nphp bin\/magento setup:upgrade\ncomposer remove VendorName\/VendorExtensionRepository<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can find the exact match for ExtensionProvider and ExtensionName in composer.json file associated with the module.<\/li>\n\n\n\n<li>Also, you can get VendorName and VendorExtension&nbsp;in&nbsp;<strong>composer.json<\/strong>&nbsp;file associated with the&nbsp;<strong>extension.or<\/strong>&nbsp;under yourmagentoinstallation<strong>\/com\/vendor\/&lt;VendorName&gt;\/&lt;VendorExtension&gt;<\/strong><\/li>\n\n\n\n<li>If you are asked for composer username and password while the uninstallation process, navigate to&nbsp;<strong>var\/composer_home\/auth.json<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong>&nbsp;Let\u2019s take the example of the same extension&nbsp;for this method as well. First of all, disable the extension, run the setup upgrade and finally remove the files via composer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento module:disable Meetanshi_Flatshipping&nbsp;--clear-static-content\ncomposer remove meetanshi\/m2-meetanshi-flatshipping\nphp bin\/magento setup:upgrade<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:&nbsp;<\/strong>Along with removing the extension, you would want to remove the extension attribute or product attribute that might be created. If so, remove the extension attribute from the table with this method:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">go to phpmyadmin -&gt; search table \u201ceav_attribute\u201d<br>and remove that extension attribute from the table<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have tried to present the easy ways to uninstall a Magento 2 module.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, you can always follow the&nbsp;<a href=\"https:\/\/developer.adobe.com\/commerce\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento DevDoc to uninstall modules<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you&nbsp;install Magento 2, usually you require to install&nbsp;Magento 2 extensions&nbsp;to build a fully functional store. As the time and website grow, you realize that&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":15639,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions\/15639"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}