Open External Links in New Tab

Automatically open all external links in new browser tabs. When visitors click links to other websites, your site stays open in the original tab, making it easy for them to return.

Use Cases

  • Keep visitors on your site while they explore referenced resources
  • Reduce bounce rate by maintaining your page in an open tab
  • Improve user experience by not navigating away unexpectedly
  • Save visitors from using the back button repeatedly

How It Works

  1. Enable the module in Switchboard
  2. External links automatically get target="_blank" added
  3. Internal links (to your own site) are unaffected
  4. Security attributes (rel="noopener noreferrer") are added automatically

Where to Find It

Location: This module works automatically on all frontend pages. No configuration needed.

What’s Modified

When the module detects an external link, it adds:

<!-- Before -->
<a href="https://external-site.com">Visit Resource</a>

<!-- After -->
<a href="https://external-site.com" target="_blank" rel="noopener noreferrer">Visit Resource</a>

Links are considered external if they:

  • Start with http:// or https://
  • Point to a different domain than your site

Examples:

  • https://google.com → Opens in new tab
  • https://external-blog.com/article → Opens in new tab
  • http://resource.org → Opens in new tab

Links are considered internal if they:

  • Point to your own domain
  • Use relative paths
  • Don’t start with http/https

Examples:

  • /about-us/ → Opens in same tab
  • https://yoursite.com/contact → Opens in same tab
  • #section → Opens in same tab

Content Types Covered

Content TypeProcessed?
Post content✅ Yes
Page content✅ Yes
Comments✅ Yes
WidgetsDepends on widget
Navigation menusNo
Theme templatesNo

Existing Target Attributes

If a link already has a target attribute, it’s not modified:

<!-- This link keeps its original target="_self" -->
<a href="https://example.com" target="_self">Link</a>

This lets you override the behavior for specific links when needed.

Security: noopener noreferrer

The module adds rel="noopener noreferrer" for security:

AttributePurpose
noopenerPrevents the new page from accessing your page’s window object
noreferrerPrevents the referrer header from being sent

This protects against “reverse tabnabbing” attacks where malicious sites could redirect your page.

FAQ

Why not let visitors choose?Many users don’t know they can Ctrl/Cmd+click to open in a new tab. This module provides a consistent, expected behavior for external links.
Does this affect navigation menus?No, navigation menus are processed differently by WordPress. To open menu links in new tabs, use the menu editor’s link target option.
Will this work with page builders?If the page builder outputs standard HTML links, yes. Most builders (Elementor, Beaver Builder, etc.) have their own “open in new tab” options for links.
Can I exclude specific external links?Add target="_self" manually to any link you want to keep in the same tab. The module respects existing target attributes.
Is there an SEO impact?No negative SEO impact. External links with noopener noreferrer work normally for SEO purposes.
What about affiliate links?External affiliate links are treated like any other external link — they’ll open in new tabs, which is typically desirable for affiliate marketing.

This module is a time-saver. Without it, you’d need to manually add target="_blank" to every external link. Now it happens automatically.

Some users prefer external links opening in the same tab. This is a design decision — use what works best for your audience.

PRO

Get access to all 147 modules with a single license

Upgrade to Pro