Magento 2 contains many modules that will not be used and are making it bigger and slower.  Backups and restores are both bigger and slower.  

How to remove unused Magento 2 modules

Be patient.  Some modules are being removed slowly and it gets you thinking the process has halted.

To check your installed modules go to Magento 2 admin 

System ->Web Setup Wizard -> Module Manager

Or command line:

php bin/magento module:status

 

Magento 2 remove unused modules.

 

Available options:

// -c clear static content, -r remove data

 

First we disable the module and test if everything is working as expected:

./bin/magento module:disable -c module_name 

And uninstall the module

./bin/magento module:uninstall -r -c module_name

 

To uninstall module that has not been installed with composer it has to be deleted.  The module files need to be deleted from app/code/ModuleName.  After deleting the files run the following command:

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy

 

We had to first enable a module:

./bin/magento module:enable Dotdigitalgroup_Email

 

// First set of DISABLE

./bin/magento module:disable -c Dotdigitalgroup_Chat

./bin/magento module:disable -c Dotdigitalgroup_Email

./bin/magento module:disable -c Amazon_Payment

./bin/magento module:disable -c Amazon_Login

./bin/magento module:disable -c Amazon_Core

./bin/magento module:disable -c Magento_Ups

./bin/magento module:disable -c Magento_Fedex

./bin/magento module:disable -c Klarna_Kp

./bin/magento module:disable -c Klarna_Ordermanagement

./bin/magento module:disable -c Klarna_Core

// First set of DISABLE  END

 

// Adobe modules

./bin/magento module:disable -c Magento_AdobeStockImage Magento_AdobeStockImageAdminUi Magento_AdobeStockImageApi

./bin/magento module:disable -c Magento_AdobeStockAsset Magento_AdobeStockAssetApi Magento_AdobeStockClient Magento_AdobeStockClientApi Magento_AdobeStockAdminUi

//Adobe modules END

 

// Second Set

./bin/magento module:disable -c Vertex_Tax Vertex_AddressValidation Temando_ShippingRemover Magento_Usps Magento_SampleData Magento_BraintreeGraphQl Magento_Braintree

// Second Set END

 

// First set of uninstall

./bin/magento module:uninstall -r -c Dotdigitalgroup_Chat Dotdigitalgroup_Email

./bin/magento module:uninstall -r -c Amazon_Payment Amazon_Login Amazon_Core

./bin/magento module:uninstall -r -c Magento_Ups Magento_Fedex

./bin/magento module:uninstall -r -c Klarna_Kp Klarna_Ordermanagement Klarna_Core

// First set of uninstall END

 

// Adobe modules uninstall

./bin/magento module:uninstall -r -c Magento_AdobeStockImage Magento_AdobeStockImageAdminUi Magento_AdobeStockImageApi

./bin/magento module:uninstall -r -c Magento_AdobeStockAsset Magento_AdobeStockAssetApi Magento_AdobeStockClient Magento_AdobeStockClientApi Magento_AdobeStockAdminUi

//Adobe modules uninstall END

 

// Second Set

./bin/magento module:uninstall -r -c Vertex_Tax Vertex_AddressValidation 

./bin/magento module:uninstall -r -c Temando_ShippingRemover Magento_Usps Magento_SampleData Magento_BraintreeGraphQl Magento_Braintree

// Second Set END

 

To Upgrade a module

composer update mageplaza/module-core

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy

php bin/magento info:dependencies:show-modules-circular

composer remove temando/module-shipping-m2