Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Custom Tokens

Security covered Under active development 5,827 sites

Part of the Token ecosystem · 21 projects

This module allows you to create custom tokens for use in Drupal. It provides a flexible way to define replacement text for various scenarios, enhancing the functionality of other modules that use the token system. The latest versions offer improved security and configuration options for defining custom tokens.

It gives the user the ability to create custom tokens for specific replacements that can improve other modules relying on the Drupal 7 token API or, for Drupal 6, the Token module.

Versions 7.x-1.x and previous relied on PHP evaluation to build custom tokens.

The new 7.x-2.x relies on input filters. While still allowing for PHP tokens through the D7 core PHP filter module, administrators can permit only HTML or plain text custom tokens.

New features in version 7.x-2.0

  • Build tokens using input filters (#1336622)
  • Define custom token types (#1341106)

Versions 7.x-1.x and previous

They are designed for developers with, at least, a little PHP knowledge. Custom tokens will evaluate and execute PHP snippets in order to provide the replacements for the tokens you define.

Version 8.x-1.x

For security, PHP snippets are not supported.

Related modules

Dependencies

Token

Alternative modules

  • The Parameters module makes parameters available as tokens and are completely configuration-based (exportable / importable through configuration). Major difference that a parameter token always starts with [parameter:*] whereas this module allows specifying a token type on root level.

Sponsored by (versions 5.x and 6.x)

Infomagnet

Sponsored by (versions 8.x)

Drupal Geeks
DROWL.de

Drupal 10–11

Ask your assistant about Custom Tokens

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • Token
  • filter Drupal core
  • text Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 4
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
8.x-1.0 Stable 10–11 Sep 30, 2025
8.x-1.0-beta2 Pre-release 10–11 Feb 25, 2025
8.x-1.0-beta1 Pre-release 10–11 Feb 4, 2025
8.x-1.0-alpha5 Pre-release 10–11 Dec 15, 2024