This project is not covered by Drupal’s security advisory policy.
Overview
Config Form Ignore is a developer-friendly alternative to the Config Ignore module that uses Drupal's Form API to mark configuration forms for exclusion from config export/import operations. Instead of maintaining lists in configuration files, developers can mark forms directly in code using a simple Form API property or using admin interface we can make specific config form ignored from config import / export.
Key Features
Code-based configuration : Mark config forms with `#config_export_ignore => TRUE` directly in your form code
Manual registration: Add any configuration via admin UI without requiring code changes
Automatic discovery:
Forms are automatically detected and registered when accessed
Global control: Enable/disable config ignore functionality globally via admin UI
Per-config control: Enable/disable individual configurations through the admin interface
Source tracking: Distinguishes between auto-discovered and manually registered configs
Flexible deletion: Manually registered configs can be deleted; auto-discovered ones persist
Non-destructive: Preserves existing configs in sync directory - doesn't delete them, just freezes them
Developer feedback: Shows informative messages on protected forms (with permission)
Import protection: Prevents ignored configs from being overwritten during `drush config:import`
Export protection: Prevents ignored configs from being updated during `drush config:export`
How It Works
Method 1: Code-Based (Automatic)
1. Mark your forms: Add `$form['#config_export_ignore'] = TRUE;` to your ConfigFormBase forms
2. Automatic registration: When the form is accessed, it's automatically detected and registered
3. Manage via UI: Configure which forms to protect via `/admin/config/development/config-form-ignore`
4. Protected operations: Config export/import operations will skip these configurations
Method 2: UI-Based (Manual)
1. Navigate to admin page: Go to `/admin/config/development/config-form-ignore`
2. Expand manual registration: Open the "Manual Registration" section
3. Enter config name: Add the machine name (e.g., `system.site`, `google_analytics.settings`)
4. Add configuration: Click "Add Configuration" to register immediately
5. Protected operations: Config export/import operations will skip these configurations
**Perfect for third-party and core modules you don't control!**
Use Cases
Perfect for:
- Environment-specific settings: API keys, credentials, local configurations
- Third-party module configs: Google Analytics, SMTP, payment gateways (without code access)
- Core Drupal settings: Site information, performance settings, user settings
- Dynamic configurations: Settings that change frequently and shouldn't be synced
- Development workflows: Settings that differ between dev/staging/production
- Module settings: Custom module configurations that shouldn't be exported
Installation
1. Copy the module to your `modules/custom` directory
2. Enable the module: `drush en config_form_ignore`
3. Configure permissions at `/admin/people/permissions#module-config_form_ignore`
4. Access the admin page at `/admin/config/development/config-form-ignore`
Usage Example
Automatic Discovery (Code-based)
<?php
namespace Drupal\my_module\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
class MyConfigForm extends ConfigFormBase {
protected function getEditableConfigNames() {
return ['my_module.settings'];
}
public function getFormId() {
return 'my_module_config_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('my_module.settings');
// Mark this form to be ignored during config export/import
$form['#config_export_ignore'] = TRUE;
$form['api_key'] = [
'#type' => 'textfield',
'#title' => $this->t('API Key'),
'#default_value' => $config->get('api_key'),
];
return parent::buildForm($form, $form_state);
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->config('my_module.settings')
->set('api_key', $form_state->getValue('api_key'))
->save();
parent::submitForm($form, $form_state);
}
}
Manual Registration (UI-based)
For configurations you don't control (core or contrib modules):
1. Go to `/admin/config/development/config-form-ignore`
2. Expand "Manual Registration"
3. Enter configuration name: `google_analytics.settings`
4. Enter form ID (optional): `google_analytics_admin_settings`
5. Click "Add Configuration"
Done! The configuration is now protected from export/import.
Comparison with Config Ignore
| Feature | Config Form Ignore | Config Ignore |
|---|---|---|
| Configuration method | Form API property in code | YAML configuration file |
| Discovery | Automatic | Manual configuration |
| Developer experience | Mark forms in code | Edit config files |
| Sync directory | Preserves existing configs | Can delete ignored configs |
| Per-environment setup | Code travels with deployment | Requires per-environment configuration |
| Per-environment setup | Environment-specific configuration can be managed directly through the Admin Console. | A code deployment is required before a new configuration can be enabled or disabled. |
| Learning curve | Minimal (one line of code) | Requires pattern knowledge |
Requirements
- Drupal 10.3+ or Drupal 11+
- PHP 8.0+
Configuration
Admin Interface
Navigate to `/admin/config/development/config-form-ignore` to:
- Manual Registration: Add third-party or core configs without code changes
- Enable/disable Config Form Ignore globally
- View all discovered configuration forms (with source indicator)
- Enable/disable individual configurations
- Delete manually registered configurations
- See when each config was discovered
Permissions
- Administer config form ignore: Access to admin interface and settings
- Assigned to: Administrator (default)
- Also shows protection messages on forms
Roadmap
Potential future features:
- Drush commands for management
- Wildcard/pattern support
- Export to Config Ignore format
- Integration tests
- Per-environment overrides
Support
- Issue queue: [Project issues](https://www.drupal.org/project/issues/config_form_ignore)
- Documentation: See README.md in the module directory
Maintainers
- Mamallan -https://www.drupal.org/u/mamallana
Project information
- Project categories: Administration tools, Developer tools
- Created by mamallana on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.


