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 (cat does not link inside concatenate); keywords such as C++ or O'Reilly work.
  • 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

  1. Grant the Administer keyword links permission to the roles that manage keywords.
  2. Add keywords at Configuration → Content authoring → Keyword links (/admin/config/content/keyword-link).
  3. 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".
  4. 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

Releases