Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module provides a text filter that automatically replaces specific links with iframe embed code. You can configure which links to convert and the corresponding iframe markup to use. This is useful for embedding content from certain external sites directly into your Drupal content.

Provides a Drupal text filter that replaces configured links with iframe markup.

What it does

  • Stores link to iframe replacements in a custom database table.
  • Adds a text filter plugin: Replace links with iframes.
  • When enabled on a text format, matching links in processed text are replaced with the configured iframe markup.

Requirements

  • Drupal 10 or 11
  • Core filter module (declared as a dependency)

Installation

  1. Enable the module.
  2. Rebuild caches.

Configuration

  1. Go to: /admin/config/content/links-to-iframes
  2. Add one or more replacements:
    • Link
    • Iframe
  3. Save replacements.

Enable the filter on a text format

  1. Go to: /admin/config/content/formats
  2. Edit the text format you want.
  3. Enable Replace links with iframes.
  4. Save the text format.

Matching behavior

  • Matches anchors by exact href value.
  • Replacement runs only where that text format is applied.

Example input and output

Configured replacement:

  • Link: https://example.com/embed#swap-for-iframe
  • Iframe: <iframe src="https://example.com/embed" frameborder=""></iframe>

Input (text using a format with the filter enabled):

<p>
   <a href="https://example.com/embed#swap-for-iframe">Open embed</a>
</p>

Output after filtering:

<p>
   <iframe src="https://example.com/embed"></iframe>
</p>

Data storage

  • Data is stored in table: links_to_iframes_filter
  • Cache tag used by the filter: links_to_iframes_filter:mappings

Testing

phpunit tests area available in the /tests folder.

Activity

Tracked releases
4
Tracked since
Mar 2026
Latest release
2 months ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.0 Stable Jun 2, 2026
1.0.0-beta1 Pre-release Apr 29, 2026
1.0.0-alpha1 Pre-release Mar 25, 2026
1.0.x-dev Dev Mar 25, 2026