Generally, it’s better to avoid opening links in new windows or tabs
- Author Benjy Stanton
- Date (updated 20 May 2020)
- Categories
- It's bad for usability, because it takes control away from users (for example, it breaks the back button functionality) and makes interactions unpredictable
- It's bad for accessibility because it can be disorienting for people, especially those who have access needs associated with perceiving visual content (for example people who use screen readers or screen magnifiers)
- It can be bad for performance and security
Exceptions
Sometimes the experience might be improved by opening links in new windows or tabs. For example, if:
- the link provides help from a different place
- the link interrupts the user journey
- the link leads to another type of document like a PDF
- the link leads to a large image which takes time to download
In these situations the link text should clearly state what's going to happen, for example:
<a href="#" rel="noopener noreferrer">Link to a thing (opens in a new window or tab)</a>
Download attribute – update 11 May 2020
Adam suggests that PDF links can be downloaded to the device, instead of opened in a new tab, by using the download
attribute.
Further reading
- Opening links in a new tab from GOV.UK Design System
- Should Links Open In New Windows? from Smashing Magazine
- G200: Opening new windows and tabs from a link only when necessary from W3C
- Link Targets and 3.2.5 from Adrian Roselli
- Open links in a new window or tab GOV.UK Design System (GitHub issue)
- Guidance on link content design from GOV.UK
- Open links in a new window or tab from HMRC Assets Frontend (old)
- Reverse Tabnabbing on Open Web Application Security Project (OWASP)