Skip to main content

Tips from the Dev Team: Using Config Split and Config Ignore to Fine-Tune Your Configuration Management Process

Reading time: 4 minutes
O8 Config Drupal

One of the many great features introduced in Drupal is configuration management. This enables developers to easily push configuration changes from their development environment to staging, then production environments. It is a robust way to ensure that all of our content types, views, menus, and other settings are correctly deployed with minimal manual work.

What Is Configuration, and What Is Content?

One of the challenges with configuration management is that there can be a fuzzy line between what is content and what is configuration. Content should not be exported as configuration: Editors and web designers should be free to change that content without it being overridden when the configuration is imported again.

Some elements are easy to divide into configuration and content: A menu is a configuration, but menu links are content. Block placement is configuration but custom block content is content. A taxonomy vocabulary is a configuration, but the term items are content.

But there are some types of elements that are a little fuzzier. Take, for example, a webform. A form is a configuration, but it also has content fields such as an instructions field and a thank-you message.

On the O8 website, we found that there were some configuration items that changed often on production while the marketing team did their work. Every time we pushed new configuration to production we would have to make sure to export these changes and commit them to git without accidentally overwriting the new configuration we were trying to deploy. We needed a better solution.

Developers also commonly use several utility modules while doing their work: we also need to make sure that this configuration is not enabled on production.

Luckily, there are a few additional modules we can use to solve these problems: Config Split and Config Ignore.

Using Config Split for Development Configuration

Config split is an excellent way to create a set of configurations that should only be enabled in certain environments. The classic use case for this is for modules and settings that are only needed for development work.

Follow these steps to implement a development-only config split:

1. Download and install Config Filter and Config Split modules

2. Move your main configuration directory to a subdirectory if it isn’t already in one (e.g. config/sync). Edit your settings.php file and change the update the main config directories path to the new subdirectory:

$config_directories[CONFIG_SYNC_DIRECTORY] = '../config/sync';

3. Create a directory for your new config split (e.g. confg/dev)

4. Set up the config split:

Screenshot showing the Config Split settings screen

Make sure the machine name of your split matches the name of the folder you set up in step 3.

5. Add your development modules to the config split settings. In this case, we are going to completely split the configuration for Database Logging, Devel, Kint and Stage File Proxy modules.

Screenshot showing the Config Split settings screen, where config items are added to the split

As you can see, it is possible to export individual configuration items here, or even use wildcards to select sets of configuration.

6. To enable this split on your development environment only, add the following line to your settings.local.php file:

$config['']['status'] = TRUE;

7. Export your configuration using drush csex.

You should see that your development modules have been exported to the dev directory set up in step 3. A normal config export using drush cex should respect your config split, but there may be a bug with some versions of drush that prevents this from working. Always make sure to check the unchanged files list in git to make sure your dev config hasn’t accidentally been exported to the main sync directory. If it has, just run drush csex again.

More detailed instructions can be found in the Drupal documentation, including an explanation of when you could choose a Conditional Split instead of Complete Split as described above.

Using Config Ignore for Items that Change on production

We could have used a config split for our web forms as well, but this presented a few logistical issues. We really don’t need to enable or disable this config in certain environments - we just need to prevent it from being overwritten on production. Config Ignore is a much better fit for this purpose.

Config Ignore simply prevents configuration from being imported. The process for setting this up is simple.

Follow these steps to implement a development-only config split:

1. In your development site, download and install Config Ignore module.

2. On the config ignore configuration screen, add the entries that you don’t want to ignore on import:

Screenshot showing the Config Ignore settings page

These machine names match the names of the yml files that are normally exported in a config export and displayed on the Configuration Synchronization screen when there are changes to import. As you can see with the web form example, you can use wildcards here.

3. Export configuration and deploy to production.

4. If changes are made to the ignored configuration items, you’ll see something like this when you try to import configuration:

Screenshot showing how ignored items appear on the Configuration Synchronization screen

What’s Next for Configuration Management

The Configuration 2.0 initiative is a new effort to improve configuration management in Drupal core. Some of the work going on in that initiative will integrate functionality currently provided by config filter and config split (planned for Drupal 8.7), along with fixes for some other ongoing headaches for developers. Find out more about the Configuration Management 2.0 initiative here and here.

About Megan McDermott

Megan built her first website in 1997, and immediately found that this was the right fit for her technical and creative interests. Over the years, Megan has developed a range of expertise including design, content development, usability, and front-end development. She started working with Drupal in 2008. She has a degree in urban planning from the University of Waterloo, where she worked for over 10 years in a variety of web-development positions. She now joins O8 from her home office in a small town in Ontario, Canada. Outside of work Megan enjoys reading, cooking, and spending time with her...
Read Full Bio

Improve Your Knowledge of Strategic Digital Marketing, Web Design, and Marketing Automation.

  • Email Advice Every Month
  • Info on Our Event Series For Marketing Leaders
  • Free Ebook On The Perfect Digital Marketing Team Structure
  • Support For Marketing Teams


You can follow all of our posts by subscribing to our RSS feed or signing up for our email newsletter above. We also share updates about our content regularly on Facebook, LinkedIn, Twitter, and YouTube.


We have a podcast for marketing leaders called the Digital Marketing Team Huddle that covers topics on digital strategy, web design, and marketing automation.


Offering social bonding, professional networking, and successful case studies, Marketing Leaders Connect (MLC) is the place to connect with professionals like yourself and solve complex marketing challenges together.


O8 is a different kind of agency, offering Fractional Marketing Services, including expert Digital Strategy, Web Design, and Marketing Automation. We understand that digital marketing gets harder each day, which is why we help marketing teams become more efficient, productive, and healthy. Here’s more information about why you might consider working with us.