A How to cleanly uninstall a Magento 2 extension is more than just "Composer remove" or deleting folders: remnants in the database, orphaned tables, cache inconsistencies, or undeleted modules in setup_module These mistakes can later lead to update errors, "class not found" exceptions, or a broken backend. We'll show you the complete process — including the steps that are missing from most tutorials.
Before uninstalling: three essential checks
- Backup of code and database
php bin/magento setup:backup --code --dbor your hosting backup tool. - Test on staging — test the uninstallation on a copy before attempting it on the live instance.
- Addiction check
composer why Vendor/Extension_NameOther modules could have the extension as a dependency.
An overview of the two standard methods (original)
Uninstalling an extension in Magento Step 2 may differ depending on whether the extension was installed manually or via Composer. Here are the steps for both scenarios:
- Uninstalling an extension installed via Composer:
If you installed an extension via Composer, you can also uninstall it via Composer. Here are the basic steps you need to follow:
a. Log in to your server via SSH and navigate to the Magento 2 root directory.
b. To uninstall the extension, run the following command. You must replace "Vendor" and "Extension_Name" with the actual name of the vendor and the extension you wish to uninstall.
Arduino
composer remove Vendor/Extension_Name
c. After Composer has finished uninstalling, run the following commands to update the database and clear the cache:
-
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush
- Uninstalling a manually installed extension:
If you installed the extension manually, the process is a bit more complicated, as you will need to manually remove files and clean the database. Here are the steps:
a. Delete all files and directories belonging to the extension from the Magento 2 directory. You will usually find them under
app/code/Vendor/ExtensionName.b. Log in to your database management system (such as phpMyAdmin) and locate all tables associated with the extension. You must delete these tables manually. Be very careful here, as deleting the wrong tables could damage the system.
c. Search the table
setup_moduleAfter entering your extension, delete this line.d. Go back to the Magento root directory and run the following commands to update the database and clear the cache:
bash
-
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush
Please ensure you always have a backup of your Magento installation and database before making any changes. This will allow you to roll back if necessary. It is also advisable to test such changes first in a staging or development environment, not in the live environment.
Verification after uninstallation
- Modules listed?
php bin/magento module:status— the extension must not appear under either “Enabled” or “Disabled”. - Check the setup table:
SELECT * FROM setup_module WHERE module = 'Vendor_ExtensionName'— should return 0 rows. - Search for remaining tables:
SHOW TABLES LIKE 'vendorname_%'Caution: Only delete manually if you are sure that no other extension is using these tables. - Cache and indexer completely refreshed:
php bin/magento cache:flush php bin/magento indexer:reindex php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f de_DE en_US - Frontend testProduct page, checkout, account area — is everything still working properly?
Common uninstallation errors
- “Cannot find Vendor_ExtensionName” After cache flush → entry in
app/etc/config.phpIt stopped. Remove manually, then.php bin/magento setup:upgrade. - “Class Vendor\ExtensionName\Model\X does not exist” → in
generated/There are old DI classes.rm -rf generated/* var/cache/* var/page_cache/*and recompile. - Schema migration fails → the extension has per
db_schema.xmlColumns created in core tables. Manual rollback using ALTER TABLE is necessary.
Frequently asked questions about Magento uninstallation
What to do if the extension doesn't have a clean Composer entry?
Manual uninstallation: Folder out app/code/Vendor/ExtensionName delete, in app/etc/config.php Remove the module entry, check database tables, clear the cache.
Will customer data from the extension be automatically deleted?
No. If the extension stores, for example, wishlists, custom loyalty points, or order attributes, this data will remain in the database. It can be removed manually if desired (be careful with foreign key associations).
Do I need to deploy again after uninstalling?
For a productive Magento installation, 99% yes — setup:upgrade + di:compile + static-content:deploy are mandatory, otherwise you'll get 503 errors or broken frontends.
Are you doing that for me?
Sure — we maintain Magento 2 shops in the DACH region and also handle individual uninstallations with testing, backup, and rollback planning. Learn more at Magento agency Hamburg.
Storetown-Media's own Magento extensions
If you're currently cleaning up old extensions and looking for modern, streamlined alternatives: we offer four of our own fully maintained Magento 2 extensions:
- STM B2B Register — streamlined B2B registration process
- STM Smart One Page Checkout — Conversion-optimized checkout
- STM Product Attachment Pro — Product attachments (PDF, datasheets)
- STM Surcharge Max — flexible additional cost logic








Be the first to leave a comment!