Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Config Token

178 sites Security covered Drupal 10–11
View on drupal.org

This module allows site builders and developers to create custom tokens that are stored as configuration. This enables these custom tokens to be exported and imported along with other site configuration, making it easier to migrate them between different sites.

Config Token lets you define your own tokens — a support email, a phone number, a promo link — and stores them as configuration instead of in the database.

That one difference is the point of the module. Because your custom tokens are configuration, they are exported, committed and imported exactly like the rest of your site. Define a token on your local site, drush cex, commit, deploy, drush cim — it is on production. No database rows to copy, no re-entering values by hand on every environment, no step that only one person remembers.

Why you might want it

  • One place to change a value. A phone number or support address that appears across dozens of nodes, blocks and views becomes a single token. Change it once.
  • Content editors do not need to touch code. They type [config_token:support_email]; you own what it resolves to.
  • It deploys with your configuration. Tokens move between environments in your normal config workflow, and live in version control where you can review and roll them back.
  • Each token has its own text format. One token renders as a real link, another stays plain text — you decide per token.
  • Per-domain values. With the Domain module, override any token per domain and the caching follows.

How it works

A config token has two parts, on two tabs of Configuration › System › Config tokens:

  1. Allowed Config tokens — define the token: machine name, label, description, and the text format its value renders through.
  2. Config tokens — give each token its value.

Keeping the two apart means the set of available tokens and their values can be managed and deployed independently. Your tokens then appear alongside every other token on the site and work anywhere tokens are supported. To use them in body text, enable Token Filter on a text format and write [config_token:your_token].

Installing the module creates a few example tokens, so there is something working to look at straight away.

Config Token or Token Custom?

Token Custom does the same job but stores its tokens in a custom database table. Deploying a token there means writing rows to that table.

  • Choose Token Custom if you want tokens created and edited entirely through the UI on production.
  • Choose Config Token if you want your tokens under version control and moving through your environments with the rest of your configuration.

If you have a lot of tokens to create at once, CSV to Config can generate the configuration in bulk.

Requirements

Token. Token Filter is optional and is the usual way to render tokens inside body fields.

Installation

composer require drupal/config_token

Supported Drupal versions

Drupal 10.3, 11 and 12. The module is tested against all three on every commit.

Depends on

Dependencies of the latest stable release

  • Token
  • filter Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Feb 2025
Latest release
5 days ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
8.x-1.9 Stable 10–11 Aug 26, 2026
8.x-1.8 Stable 10–11 Aug 25, 2026
8.x-1.7 Stable 8–11 Feb 12, 2025