Magento 2.2.2多店铺多主题场景下特定视图禁用模块方法
Hey there! Great question—yes, you absolutely can disable a module for specific store views in Magento 2.2.2, even with your multi-store setup using distinct themes. Let’s walk through the practical approaches you can use, based on your scenario:
Many core Magento modules and well-built third-party modules include a store-view-specific enable/disable toggle right in the admin. Here's how to use it:
- Log into your Magento admin, head to Stores > Configuration
- In the top-left dropdown labeled Store View, pick the exact store view where you want to disable the module (skip "Default Config" or "Website" unless you want to apply changes to a broader scope)
- Navigate to the module's configuration section (core modules might live under Advanced or their functional category; third-party modules often have their own left-hand menu item)
- Look for an "Enabled" or similar toggle, set it to No, then click Save Config
- Don’t forget to flush cache: Go to System > Cache Management and refresh the relevant cache types
If the module doesn’t have an admin-level store view toggle, Magento’s CLI tools let you target specific store views directly. You’ll need two things: the module’s full name (e.g., Vendor_Module) and your target store view’s code (find this in Stores > All Stores):
- SSH into your server and navigate to your Magento root directory
- Run this command to disable the module for your chosen store view:
bin/magento module:disable --store=your_store_view_code Vendor_Module - Clean cache and redeploy static content (required for production mode):
bin/magento cache:clean bin/magento setup:static-content:deploy
Pro tip: This command adds the disable setting directly to the
core_config_datatable, which is safer than manual file edits.
Only use this if you can’t access the admin or CLI—always back up your database first!
- Access your Magento database and open the
core_config_datatable - Look for or create a record with:
path:advanced/modules_disabled/Vendor_Modulescope:storescope_id: The ID of your target store view (find this in thestoretable)value:1(1 = disabled, 0 = enabled)
- Save the record and flush your Magento cache to apply changes
- Check module dependencies first with
bin/magento module:status Vendor_Module—disabling a dependent module might break other functionality - If your store uses custom themes, double-check that the theme doesn’t rely on code from the module you’re disabling (this can cause frontend errors)
- Always back up your code and database before making changes, especially in a production environment!
内容的提问来源于stack exchange,提问作者Toto Memeng

