Why We Avoid Using target="_blank" (And When We Should Use It)

Links are the backbone of the web, but how they behave matters. One common debate is whether to force links to open in new tabs using target="_blank". While this attribute is valid in HTML5, it’s often misused. Let’s break down why we avoid it—and when it’s actually a good idea.

What Does target="_blank" Do?

When added to a link, target="_blank" tells the browser to open the URL in a new window or tab. While this can seem helpful, it overrides the user’s default behavior and control. Here’s why we think carefully before using it:

Bad Reasons to Use target="_blank"

1. “I Prefer It That Way”

Users expect links to open in the same tab by default. Forcing a new tab disrupts their browsing flow (e.g., cluttering their tab bar or breaking the “Back” button).
Better approach: Let users decide. They can [Ctrl/Cmd + Click] to open links in new tabs if they choose.

2. “To Keep Users on Our Site”

Forcing links to external sites into new tabs feels manipulative. Users can always return to your site if they want to—trust them to make that choice.

Branding tip: Engage users with great content, not by trapping them.

3. “Internal vs. External Links Are Different”

Some argue external links should open in new tabs while internal ones don’t. This inconsistency confuses users and isn’t a standard convention.
Golden rule: Treat all links the same unless there’s a user-centric reason not to.

4. “The Link Is a PDF or Download”

Non-web resources (like PDFs) don’t need special treatment. Use the download attribute if you want users to save the file directly.

5. “My Client Insists”

If a client requests target="_blank", explain the downsides. Frame it as a user experience issue: “Most users prefer control over their browsing. Let’s respect that.”

6. “It’s on an Infinite-Scroll Page”

Infinite scroll shouldn’t justify forcing new tabs. Instead, solve the problem of returning users by restoring their scroll position (e.g., with session storage).

Good Reasons to Use target="_blank"

1. User-Initiated Media Playback

If a video, podcast, or music is playing, opening a new tab prevents interruptions. For example, a user listening to a playlist shouldn’t lose their progress.

2. Unsaved Work on the Page

If a user is filling out a form, editing code, or designing something, links should open in new tabs to avoid losing their progress.
Pro tip: Add a warning (e.g., “Are you sure you want to leave?”) for extra protection.

3. Legacy Tech Constraints

Rare cases, like outdated email clients or enterprise tools, might require target="_blank" for compatibility.

Technical Considerations

If you must use target="_blank", always add rel="noopener" for security:

<a href="https://example.com" target="_blank" rel="noopener">Safe Link</a>

Why? Without rel="noopener", the new page can access the original page’s window object, posing security risks.

Key Takeaways

  • Respect user choice: Default to same-tab behavior.
  • Use sparingly: Only for media, unsaved work, or specific tech needs.
  • Prioritize security: Always include rel="noopener".

Final Thoughts

The web works best when users control their experience. By avoiding target="_blank" unless absolutely necessary, we create a more respectful, intuitive browsing environment.

Next time you’re tempted to force a new tab, ask: “Is this for the user’s benefit—or mine?”

Further reading: Security risks of target=”_blank” | MDN docs on link attributes

HTML Web Developer

Share

Related posts

More Posts

Stay in the loop.

Get notified when we release a new feature or blog post.