Drupal - Exclude configuration from import/export

You can use the "Config Ignore" module: https://www.drupal.org/project/config_ignore

Ever experienced that your site's configuration was overridden by the configuration on the filesystem, when doing a drush cim?

Not anymore!

This module is a tool to let you keep the configuration you want, in place.


You can use a combination of config_ignore and config_split for this.

Config ignore allows you to ignore a subset of configuration entities during import (also prevents deletes since the 2.x release). Unfortunately it doesn't prevent excluding config during export.

To exclude configuration entities during export, you can use config_split, create a new config_split entity, and leave the folder empty. This prevents the configuration from being exported to the file system; instead, it exports it in the database.

I wrote Exclude config from configuration management in Drupal 8 about this topic.


It's not possible to have excludes specifically, but there is something.

Just like $conf in Drupal 7, there's $config in settings.php that you can use to override anything in configuration locally. The format is $config['name.of.config']['nested']['key'].

Note that whatever is stored in configuration is still in git, so you either need to keep none or your testing access codes in git. Also, the UI will show what's actually stored in config and will currently not provide any indication that it is overridden. There are pending issues to improve that.

I understand that this has limitations but right now, it's not possible to keep something out of the exported configuration. As far as I know.