Cleanly uninstalling a Magento 2 extension takes more than "composer remove" or deleting a folder: leftover database entries, orphaned tables, cache inconsistencies or modules still listed in setup_module later cause update errors, "Class not found" exceptions or a broken admin panel. We walk you through the complete process, including the steps most tutorials leave out.
Before uninstalling: three essential checks
- Back up code and database —
php bin/magento setup:backup --code --dbor your hosting provider's backup tool. - Test on staging — test the uninstall on a copy before touching the live instance.
- Dependency check —
composer why Vendor/Extension_Name: other modules may depend on the extension.
The two standard methods at a glance (original)
How you uninstall an extension in Magento 2 depends on whether it 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. These are the basic steps:
a. Log in to your server via SSH and navigate to the Magento 2 root directory.
b. Run the following command to uninstall the extension. Replace "Vendor" and "Extension_Name" with the actual vendor and extension name you want to uninstall.
arduino
composer remove Vendor/Extension_Name
c. Once 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 involved, because you need to remove files and clean up the database by hand. 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 tool (such as phpMyAdmin) and find all tables related to the extension. You need to delete these tables manually. Be very careful here, as deleting the wrong tables can damage the system.
c. In the
setup_moduletable, find the entry for your extension and delete that row.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
Always make sure you have a backup of your Magento installation and your database before making any changes. That way you can roll back if needed. It is also a good idea to test changes like these in a staging or development environment first rather than in production.
Verification after uninstalling
- Is the module still listed?
php bin/magento module:status— the extension must appear neither under “Enabled” nor under “Disabled”. - Check the setup table:
SELECT * FROM setup_module WHERE module = 'Vendor_ExtensionName'— should return 0 rows. - Look for leftover tables:
SHOW TABLES LIKE 'vendorname_%'. Caution: only delete them manually if you are sure no other extension also uses these tables. - Fully refresh cache and indexers:
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 test: product page, checkout, account area — is everything still working properly?
Common mistakes when uninstalling
- “Cannot find Vendor_ExtensionName” after a cache flush → the entry in
app/etc/config.phpwas left behind. Remove it manually, then runphp bin/magento setup:upgrade. - “Class VendorExtensionNameModelX does not exist” → old DI classes remain in
generated/. Runrm -rf generated/* var/cache/* var/page_cache/*and recompile. - Schema migration fails → the extension created columns in core tables via
db_schema.xml. A manual rollback using ALTER TABLE is required.
FAQ: uninstalling Magento extensions
What if the extension has no proper Composer entry?
Manual uninstallation: delete the folder app/code/Vendor/ExtensionName, remove the module entry from app/etc/config.php, check the database tables and clear the cache.
Is the extension's customer data deleted automatically?
No. If the extension stored wishlists, custom loyalty points or order attributes, for example, that data remains in the database. Remove it manually if needed (watch out for foreign key relationships).
Do I need a new deployment after uninstalling?
On a production Magento installation, almost always yes — setup:upgrade + di:compile + static-content:deploy are mandatory, otherwise you will get 503 errors or broken frontends.
Can you do this for me?
Yes — we maintain Magento 2 stores in the DACH region and also handle individual uninstallations, including testing, backup and a rollback plan. Learn more at Magento Agency Hamburg.
Magento extensions by Storetown-Media
If you are cleaning up old extensions and looking for modern, lightweight 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 (PDFs, data sheets)
- STM Surcharge Max — flexible surcharge logic






















{% endif %}
{% if title and title != "" %}
{{ title }}
{% endif %}
{% if excerpt and excerpt != "" %}