WebberZone Link Warnings v1.7: URL Pattern Rules, Download Scope and More

A warning that fits an external article may not fit an affiliate link, a file download, or an internal redirect. Applying the same message to all of them leaves site owners with limited control over what visitors see.

For WebberZone Link Warnings 1.7.0, I’ve added URL pattern rules, a setting to limit download warnings to external sites, and an option to hide warnings from logged-in users or selected roles. The release also hardens redirect screens and corrects several cases where warnings described the wrong behavior or could be skipped.

WebberZone Link Warnings v1.7: URL Pattern Rules, Download Scope and More

Give matching links their own warning

The new Rules tab lets you assign a warning method and an optional message to links that match a URL pattern. You can also exclude matching links from warnings. The Link Warnings settings reference covers the rules and other settings.

Open Settings → Link Warnings → Rules, click Add rule, and complete the URL Pattern, Action, and optional Message fields. A new rule starts with Modal dialog as its action. Choose another warning method or Exclude (no warning) as needed, then click Save Changes.

These patterns cover a few common uses:

PatternMatches
example.comLinks to that exact domain, regardless of path.
*.example.comLinks to its subdomains, excluding the base domain.
www.amazon.com/dp/*Links to www.amazon.com whose path starts with /dp/.
/go/*Root-relative or full URLs on your own site whose path starts with /go/.

* matches any characters within the domain or path being matched. A domain-only pattern matches the domain regardless of path. The domain is matched exactly unless you use a wildcard, so example.com does not cover www.example.com. Add a separate rule for each domain you need. A pattern containing a path must match through the end of the address, including its query string, so keep the trailing * when you want to match everything below a path. Relative links without a leading slash, such as go/product/, are not matched.

Rules are checked from top to bottom, and the first match wins. Put a specific exception above a broader rule that would otherwise catch the same link. Links that match no rule continue to use your existing settings.

A warning rule can apply to internal links or override an entry in Excluded Domains. The existing Affiliate Link and Force External classes take precedence over an exclusion rule, while the Suppress Icon classes still hide visual indicators.

If visitors can dismiss your modals, dismissals are kept separate for each rule. Dismissing the general external-link warning does not also dismiss a rule’s custom message. The existing Modal Frequency setting still defaults to Always show the modal, so this only affects sites where dismissal is enabled.

No rules are created automatically when you update.

Limit download warnings to files on other sites

Version 1.6 introduced warnings for configured downloadable file extensions, including files hosted on your own site. Version 1.7 adds control over that scope.

Under Settings → Link Warnings → Advanced → Download Links, set Download Warning Scope to Download links to external sites only to skip download warnings for files on your own site. This includes root-relative links such as /wp-content/uploads/report.pdf.

The default remains All download links. Updating does not switch existing sites to external-only download warnings.

This setting controls download warnings, not every reason a link might receive a warning. A matching rule or your new-tab scope can still apply. Links marked with an Affiliate Link or Force External class also continue to count as external.

Hide warnings while you work on your site

The new Disable Warnings For setting is under Settings → Link Warnings → General. Select All logged-in users, or choose individual roles such as Administrator or Editor.

For those users, the plugin suppresses visible indicators, modals, and redirect warnings, including warnings assigned by rules. Configured link attributes still apply, and processed links that open in a new tab retain their hidden screen reader text.

No users or roles are selected by default. Anonymous visitors still receive warnings based on your settings. On multisite, role selections use the user’s roles on the current site. Choose All logged-in users if you also want to cover super admins who are not members of that site.

If your cache serves pages to logged-in users, check that it separates users who should see warnings from those who should not. Otherwise, a shared cached page can carry the wrong warning state.

Redirect screens require confirmation in more situations

External redirect links opened from an email, bookmark, or another site now wait for the visitor to click Continue to site. The countdown runs only when the browser reports that the visitor arrived from your site. Same-site destinations remain eligible for automatic redirects.

Redirect links generated while the plugin processes comment text or previews on the server require confirmation unless the destination is on your site or matches a redirect rule. The same applies to links marked with rel="ugc", including links processed only in the browser. For an external destination covered by a redirect rule, the visitor must still arrive from your site for the countdown to run.

Redirect links signed by versions before 1.7.0 remain usable, but always require a confirmation click. Valid signed links also continue to work after you change the warning method or rules, so links in cached pages do not stop working because of that settings change.

This source check applies when the plugin generates a redirect link. A ready-made signed redirect URL pasted into a comment is already a same-site link and is not reclassified by its original source.

The redirect screen sends headers to prevent caching. If signing a redirect URL fails, the browser asks for confirmation instead of following the destination without warning. The redirect screen customization guide explains countdown behavior and template overrides.

More accurate link announcements

Links that opened in the same tab were being announced to screen readers as opening in a new window. Hidden new-window text and the corresponding ARIA announcement now depend on whether the processed link actually opens a new tab.

Other fixes in this release:

  • Mixed-case values such as target="_BLANK" are recognized consistently when applying warnings, link attributes, and navigation behavior.
  • URLs containing backslashes or control characters are normalized before classification so they cannot evade warnings by appearing internal or excluded.
  • Author-supplied exclusion and processing markers no longer bypass warnings.
  • The Inline Indicator Scope description now correctly explains that its second option also applies modal and redirect warnings to internal links opening in a new tab.

Developers can use the new wzlw_link_rules and wzlw_is_disabled_for_current_user filters, along with the wzlw_is_disabled_for_current_user() function, to integrate rules and warning visibility with their own code. The Link Warnings developer reference documents these APIs. For visual changes, see Styling WebberZone Link Warnings.

After updating

The requirements remain WordPress 6.6 or later and PHP 7.4 or later. Existing settings are preserved, and no database migration is required. The plugin continues to modify rendered output rather than rewriting stored post content. For setup instructions, see Getting started with WebberZone Link Warnings.

If you use a page cache, clear it after updating so pages are rebuilt with the new link markup.

The new rules and user exclusions are opt-in. Download warnings keep their existing all-downloads scope unless you change it. Redirect hardening and the fixes apply without enabling a new setting.

If you use redirect warnings, check a link from a page on your site and then open its redirect URL directly. The first can count down, while a direct visit to an external destination should wait for confirmation. The new script re-signs links in older cached markup when it can. Old signed redirect URLs that open directly still require confirmation; if browser signing fails, the visitor gets a confirmation prompt.

Start with one rule for a link that needs a different message, then check both a matching link and one that should keep your general warning.

Leave a Reply

Your email address will not be published. Required fields are marked *