Keyword Link automatically turns chosen words or phrases in your content into links. Define a keyword/link pair once, and every matching word in your text links to it: useful for internal cross-linking, glossary-style links and partner or affiliate links (SEO).
Example: with the keyword dog's health → /dog-illness, the text
A dog's health is as important as a human's health.
is displayed as
A dog's health is as important as a human's health.
Version 2.x is a complete rewrite for Drupal 10 and 11. Links are added by a text filter at render time, so your stored content is never modified: change or delete a keyword and every page updates.
Features
- Keyword/link pairs stored as config entities – exportable and deployable with
drush cex/drush cim. - Link to a full URL or an internal path (
/node/1, path aliases supported). - Per-keyword options: nofollow, first match only, open in new window (with
rel="noopener noreferrer"), ignore case, and weight (processing order). - "Where to apply" conditions per keyword, like block visibility:
- Content types
- Languages
- Pages (include / exclude list with wildcards, e.g.
/blog/*,<front>) - HTML elements to skip (headings, block quotes, lists, tables, bold/italic, captions)
- Safe HTML processing: works on parsed DOM text nodes only. Existing links,
<code>,<pre>,<script>,<style>, form controls and attributes (alt,title) are never touched, so links are never nested. - Whole-word, Unicode-aware matching (
catdoes not link insideconcatenate); keywords such asC++orO'Reillywork. - Proper cache tags and contexts – saving a keyword refreshes affected pages.
- Every link is wrapped in
<span class="keyword_link">for easy CSS styling (e.g. to mark affiliate links). - Migrate source plugin to import keywords from the Drupal 6/7 version.
Post-installation
- Grant the Administer keyword links permission to the roles that manage keywords.
- Add keywords at Configuration → Content authoring → Keyword links (
/admin/config/content/keyword-link). - Required: enable the Keyword link filter on your text format(s) at
/admin/config/content/formats, and place it after "Limit allowed HTML and correct faulty HTML". - Clear caches and view your content.
Requirements
- Drupal 10 or 11
- Core modules: Filter and Path Alias (enabled by default)
- Optional: Migrate and Migrate Drupal (only for importing old keywords)
Similar projects
Glossify links taxonomy terms or node titles found in text. Keyword Link is simpler: you define any keyword and any target URL, with per-keyword link attributes and visibility conditions.
Project information
- Project categories: Content display
3 sites report using this module
- Created by livido on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Initial stable release for Drupal 10 and Drupal 11.