I am working on Magento-2.2.4. I have installed the no.of extensions which are supported to Magento-2.2 version by copying directly the zip files into server.

Some of the extensions are not working. So that, I have deleted the extension folder from my app directory.

When i run php bin/magento setup:upgrade command, The database tables of the all extensions were created. Now, i deleted some extensions. But, the deleted extension's database tables are there in my database.

How to clear those all deleted extension's tables from database?

3 Answers 3

  1. You should manually delete entries of extension/module from the table called setup_module in the database.
  2. By the way, it's not a good way to directly delete module. instead, disable the module. if the extension was added using composer you can uninstall using composer.
  3. You should delete entry of module from setup_module table
  4. you cant uninstall if you haven't installed by composer
  • Then you should delete entry of module from setup_module table Commented Sep 7, 2018 at 17:00
  • you cant uninstall if you haven't installed by composer Commented Sep 10, 2018 at 7:02


php bin/magento module:disable Module_Name

If a module was installed with php composer.phar require ... then you can try Magento's command php magento module:uninstall namespace_module --remove-data as described on the official documentation. This also has some options for backing up those tables, in case you need them later. This only will remove the tables if the module has an Uninstall script.

If the module doesn't have an uninstall script or if its a module you have in app/code, then there unfortunately isn't any magic script. You will have to remove any tables you don't want manually. You'll have to look at each modules Setup folder for InstallSchema.php and UpgradeSchema.php and find instances of the newTable or createTable functions.

This regex should find where tables are installed in Magento setup scripts:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.