I know there are methods for preventing specific configurations from being exported but how do you prevent specific module's installed/un-installed status from being exported?

For example, I'd like dev,stage_file_proxy to be enabled on dev but not prod. And the reverse for mem_cache.

Also, is there a way to prevent the performance page settings (CSS, JS aggregation) from being exported?


1 Answer 1


You can use$settings['config_exclude_modules'] key in settings.php to exclude modules.

For example Refer example.settings.php

  • Thank you! Do you know how I can prevent the performance (aggregation) settings from exporting? Commented Apr 29, 2022 at 17:41
  • In a world where you sync a database from live to dev or local, this method is not really going to work very well. For example, it won't enable your dev modules or disable your live modules after syncing a database.
    – sonfd
    Commented Apr 29, 2022 at 18:01
  • Yes, like this git.drupalcode.org/project/drupal/-/blob/9.4.x/sites/… Commented Apr 29, 2022 at 19:24
  • That doesn't prevent the settings from being exported - it only overrides the values on the environment with that settings.php file.
    – sonfd
    Commented Apr 29, 2022 at 20:26
  • Yes, you are correct. @sonfd. Commented Apr 30, 2022 at 4:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.