Magento2 – How to Uninstall a Magento 2 Module

magento2uninstall-module

I installed a Magento 2 module from here using this link https://github.com/Sebwite/magento2-category-sidebar. using these commands

Include the repository: composer require sebwite/magento2-category-sidebar
Enable the extension: php bin/magento --clear-static-content module:enable Sebwite_Sidebar
Upgrade db scheme: php bin/magento setup:upgrade
Clear cache

But now I want to uninstall it using

sudo php bin/magento module:uninstall -r Sebwite_Sidebar

it says

Sebwite_Sidebar is not an installed composer package

how to remove its structure database Mean to say completely remove it

Best Answer

If you installed the module manually: remove the folder app/code/<Vendor>/<Module> drop module tables from database remove the config settings.

DELETE FROM core_config_data WHERE path LIKE 'vendor_module/%'

remove the module <Vendor>_<Module> from app/etc/config.php

remove the module <Vendor>_<Module> from table setup_module

DELETE FROM setup_module WHERE module='<Vendor>_<Module>'

Then next follow the command upgrade and compile.

If you installed it via composer:

run this in console:

php bin/magento module:uninstall -r <Vendor>_<Module>

Thanks.

Related Topic