Add configuration option to not override rel="referrer" if already set

Created on 28 August 2025, about 2 months ago

The extlink module currently has a configuration option "Do not override rel="follow", if set"
that prevents the module from overriding manually set rel="follow" attributes when the nofollow
option is enabled. However, there is no equivalent option for the noreferrer functionality.

This patch adds a new configuration option "Do not override rel="referrer", if set" that works
similarly to the existing nofollow override option. When enabled, this option prevents the
module from adding rel="noreferrer" to links that already have rel="referrer" manually set.

Use case: Content editors may want to manually set certain external links to use rel="referrer"
to allow the destination site to see the referrer information, while still having the module
automatically add rel="noreferrer" to other external links for privacy/security reasons.

Changes included:
- New configuration setting extlink_referrer_no_override
- Form field with conditional visibility (only shows when noreferrer is enabled)
- JavaScript logic to check for existing rel="referrer" before adding rel="noreferrer"
- Configuration schema and default settings updated

This maintains consistency with the existing nofollow override functionality and provides
content editors with granular control over referrer policy on external links.

✨ Feature request
Status

Downport

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024