Magento 2 Experten — Hyvä Theme, Tailwind CSS & SEO aus einer Hand ›

Linking to External Websites: target="_blank"

Linking to External Websites: target="_blank"

~6 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026

You now know two kinds of links: relative paths to your own pages and absolute addresses to other people's websites. This chapter covers a useful extra attribute specifically for external links.

The problem: the visitor disappears

When someone clicks a link to another website, it usually opens in the same browser tab - your own website is then gone, and the visitor has to click back to return. For important internal links (like in chapter 14) that's exactly what you want. But for a link to a different website, it's often nicer if it opens in a new tab.

The target="_blank" attribute

<a href="https://www.fifa.com" target="_blank">FIFA website</a>

The target="_blank" attribute tells the browser: "open this link in a new tab instead of the current one." Notice: as mentioned before, a tag can have several attributes at once - here href and target simply sit next to each other, separated by a space.

An important security extra: rel="noopener"

Whenever you use target="_blank", you should also add one more attribute for security reasons: rel="noopener". The technical reason is a bit advanced (in short: the newly opened page could otherwise theoretically get access to your own page), but the fix is simple: just always add it whenever you use target="_blank".

<a href="https://www.fifa.com" target="_blank" rel="noopener">FIFA website</a>

Update the FIFA link on your website so it opens in a new tab:

index.html
<h2>My Club</h2>
<p>I play for Sample Town FC. More info can be found on the
  <a href="https://www.fifa.com" target="_blank" rel="noopener">FIFA website</a>.</p>

Achtung: Don't use target="_blank" on every link, only on links to other websites. For links within your own site (like between index.html and players.html), it's usually better to stay in the same tab - constantly opening new tabs confuses visitors.

Tipp: Rule of thumb: internal links (to your own pages) stay in the same tab, external links (to other websites) open in a new tab with target="_blank" rel="noopener".