Stratus Magento 2 Guides - Manually Uninstalling an Extension or Module

If you’re having trouble uninstalling an extension or module from Magento 2 via Composer, you may need to manually uninstall.

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 environment before attempting it on a Production environment.

To remove an extension/module manually:

  1. Log into the environment 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”.

Last modified January 1, 0001