> For the complete documentation index, see [llms.txt](https://govtnz.gitbook.io/nz-government-web-standards/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://govtnz.gitbook.io/nz-government-web-standards/content-accessibility/dont-force-links-to-open-in-a-new-window-by-default.md).

# Links - Don't force links to open in a new window by default

To clarify, this refers to the practice of coding links so that they always open in a new window or tab by default. The link code will look something like this: `<a href="link-destination.html" target="_blank">Link opening in a new window </a>`

It matters to a user if new windows are popping up when they didn’t expect them. The best practice is to have them open in the same window and give the user a choice as to whether they want to open the link in a new tab/window or not.

The exception to this is where you’re logged in somewhere and referencing a link outside the authenticated area. Or where you’re in something like a form where data would be lost if the page refreshed to somewhere else.

If you want to read more of the debate about this, here’s a good, recent article.

[http://libux.co/links-should-open-in-the-same-window/](https://github.com/govtnz/nz-government-web-standards/tree/2a95f399bd7890476801b67583296d0a40d79ce8/h%20ttp:/libux.co/links-should-open-in-the-same-window/README.md)
