Custom Tokens allows users to define their own tokens via the administrative UI using standard input filters. These tokens can then be used throughout the site in any field that supports token replacement.
- No hard dependencies.
- Recommended: Token Filter, to use custom tokens in body text and other formatted fields.
Install this module using the official Backdrop CMS instructions at https://docs.backdropcms.org/documentation/extend-with-modules.
- Text Formats: Visit
Configuration > Content authoring > Text editors and formats(admin/config/content/formats). With Token Filter installed, enable its "Replace tokens" filter for the text formats you intend to use. - Creating Tokens: Navigate to
Structure > Custom Tokens(admin/structure/token-custom). - Nesting: You can use existing site tokens (like
[site:name]) inside your custom token content. A token cannot contain itself, directly or through other custom tokens; it is left empty and a warning is logged. - Placement: Use your custom token anywhere tokens are accepted using the syntax
[custom:your_machine_name].
If you are creating "Inline" tokens (like a Company address "Line1, Line 2, Area, City, Zip Code") and find that they are being wrapped in <p> tags:
- Go to
Configuration > Content authoring > Text editors and formats(admin/config/content/formats) and create a "Plain" or "Snippet" text format. - Ensure "Convert line breaks into HTML (i.e.
and)" is disabled for that format.
- Set the Editor to "None" for that format.
- When creating your custom token, select this new format to ensure the output is returned as raw text without HTML wrappers.
Note: As of version 1.x-1.3, PHP execution within tokens is no longer supported in favor of Backdrop security best practices.
Additional documentation is located in the Wiki: https://github.com/backdrop-contrib/token_custom/wiki
Bugs and Feature requests should be reported in the Issue Queue: https://github.com/backdrop-contrib/token_custom/issues
Reviewed on 29 October 2026 for the kinds of vulnerability reported in the Drupal security advisories of 7 to 28 October 2026. Those advisories were for Drupal 10/11 and do not apply to Backdrop directly; this module was checked for the same classes of mistake.
Please report security issues privately to security@backdropcms.org, not in the issue queue.
- Steve Moorhouse (albanycomputers)
- Additional maintainers welcomed.
- Steve Moorhouse - Zulip (DrAlbany)
- AI Assisted
This module is a port of the Drupal Custom Tokens module.
- Ariel Barreiro (hanoii)
- Rodolfo Ripado (gaspaio)
This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.