Skip to content

Manually Uninstalling a Magento 2 Extension or Module

NOTE: Before starting any modification that may affect your store, always backup your store and database first. Preferably, you will be performing this action on a Development instance before attempting it on a Production environment.

To remove an extension/module manually:

  1. Log into the Magento instance via SSH.
  2. Go to the root of the Magento 2 installation and remove the folder, app/code/<Vendor>/<Module>.
  3. Run n98-magerun2 db:console to access the database.
  4. Drop the module tabels from the database:

    DELETE FROM core_config_data WHERE path LIKE '/%'; DELETE FROM setup_module WHERE module='';

(Hint: make sure the database does not have a prefix before running anything.)

  1. Remove the module/extension _ from app/etc/config.php.

Uninstalling via Composer

If the extension/module had been installed using composer, the procedure, of course, is a lot easier. To recap, from the root of the Magento 2 installation, run:

php bin/magento module:uninstall --backup-code --backup-db -r -c <Vendor>_<Module>

After Uninstalling an Extension

After you have uninstalled an extension or module, you need to run the following command via SSH:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:clean && php bin/magento cache:flush
php bin/magento indexer:reindex && redis-cli -h redis flushall

NOTE: It is not possible to remove or uninstall default Magento modules if they are not installed with Composer. Many of these are sued as integration modules. However, if you need to cease using a default module, you can simply set it to "disable".