Posted on 31/01/2025 10:48:45
Maybe.
I think you should consider if external links should open in new windows - users knows how to handle that by them selves and if they dont, opening up a new window will probably confuse them.
That said, I am more fan of opening external links in new tabs/windows as a site wide setting instead of needing to take that into consideration every time a link is inserted.
That can be achieved with a simple script on the page:
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll("a").forEach(link => {
const href = link.getAttribute("href");
if (href && href.match(/^https?:\/\//i)) {
link.setAttribute("target", "_blank");
}
});
});
Other considerations with my chat with a smart tool (AI):
Forcing external links to open in a new window or tab is a common UX pattern, but it comes with both benefits and drawbacks. Whether or not to use it depends on the context of your website and its audience. Here's a breakdown of the UX considerations:
👍 Pros of Opening External Links in a New Tab
1. Prevents Losing the User’s Place
- If the user is deep into your content and clicks an external link, they won’t lose their progress.
- Especially useful for long articles, tutorials, or forms where users may need to reference an external resource but return to your page.
2. Keeps Users Engaged with Your Site
- By keeping your site open in the background, it increases the chances that users will return instead of bouncing away permanently.
- Helpful for blogs, e-commerce, or knowledge bases where retention matters.
3. Standard UX for Certain Types of Sites
- Many news sites, blogs, and SaaS documentation pages open external links in a new tab to provide additional references without disrupting the reading experience.
4. Reduces Accidental Navigation Away
- If users expect an external link to open in a new tab but it doesn’t, they might get frustrated when they leave your site unintentionally.
👎 Cons of Opening External Links in a New Tab
1. Takes Control Away from Users
- Users expect to decide how a link opens (e.g., right-click → "Open in new tab").
- Some users prefer to navigate back rather than having multiple tabs open.
2. Can Be Confusing for Less Tech-Savvy Users
- Some users might not notice a new tab opened, especially on mobile where tab management is clunky.
- They may think they "lost" your website if they don't realize it’s still open in another tab.
3. Inconsistent Behavior Across the Web
- Some websites open external links in the same tab, others force a new one—this inconsistency can be jarring.
- If a user expects a link to open in the same tab but it doesn’t, it can break their browsing flow.
4. Accessibility Concerns
- Screen readers may not announce that a new tab was opened, leading to confusion for visually impaired users.
- It’s best to provide a visual indicator (e.g., an external link icon) or an announcement ("opens in a new tab").
🛠 Best Practices If You Choose to Open External Links in New Tabs
If you decide that opening external links in a new tab is the best experience for your site, here’s how to make it more user-friendly:
✅ Use an External Link Icon
✅ Notify Users with Accessible Text
✅ Use rel="noopener noreferrer"
for Security
- Prevents security vulnerabilities when opening links in a new tab.
✅ Be Consistent
- If you do this for some links, do it for all external links to avoid confusion.
✅ Let Users Decide When Possible
- Consider not forcing links into a new tab unless it’s truly necessary (like preventing data loss on a form submission page).
🚀 Final Verdict: Should You Do It?
- YES if your site is content-heavy (blog, documentation, news) and you want users to stay engaged with your page.
- MAYBE if your users frequently navigate between your content and external references (like research or e-learning).
- NO if it’s a standard website or users should be in control (e.g., an e-commerce site where users compare prices).
The best UX decision is the one that aligns with your users’ expectations and provides clear affordances so they know what to expect. 🚀