Skip to main content
Login Join
Snippet · HTML

Safely Open External Links

Shared by Hiral solanki · September 17, 2026

8 views
2 upvotes
Back to Snippets

Opens an external link in a new browser tab while using noopener noreferrer to prevent the new page from accessing the original window.

<a
    href="https://example.com"
    target="_blank"
    rel="noopener noreferrer"
>
    Visit Website
</a>
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments