Opening links in a new tab

Posted in: ,

Not every external link needs to be opened in a new tab. 

Forcing a link to open in a new tab takes the choice away from your visitor. I can open a link in a new tab a few different ways if I want to — I can’t force a link to open in the same tab if you’ve told the link to do the opposite. Forcing links to open in a new tab goes against expectations, and it takes away my choice.

Good user experience centers around giving people what they’re expecting. If a link doesn’t tell me that it’s opening in a new tab, I have no reason to think it will.

There’s the accessibility concept of providing a predictable web experience (as well as specifically 3.2.5 Change on Request). It can be especially disorienting or confusing for users with visual impairments if they aren’t explicitly warned that a link opens in a new tab.

There are even privacy and security concerns that require some additional steps you need to take.

So if opening links in a new tab causes issues with user experience, accessibility, privacy, and security, why do people force links to open in new tabs?

Why do sites force new tabs?

The practice of “setting all links that aren’t on your site to open in a new tab” came from the old bounce rate analytics metric as well as a combination of time on page and session duration stats. There was this belief that a user should never navigate away from your site, which would also theoretically increase those metrics and improve SEO.

Rather than relying on the time spent on a page, it matters more whether someone is able to find the information they’re looking for. Google has taken steps to address these types of things by moving towards engagement rate and changing what the bounce rate actually measures. Even session duration can be tricky to measure and often underestimates the amount of time someone spends on your site.

No one metric can give a full picture of your website. If you provide a positive user experience and help people find the information they’re looking for, they’re more likely to come back.

What about user preference?

Some people might have a strong preference one way or the other. While there’s no way to set your default browser preference for how links get opened, people who prefer to have links open in a new tab have quite a few options: keyboard shortcuts, browser extensions, touch screen long press, and right click context menus.

People who don’t want their links to open in new tabs have no options if a link forces it to open in a new tab.

People who prefer links opening in new tabs and argue for everyone to code their off-site links to open in new tabs usually follow up with some variation of “I know how to force open these links but not everyone does!” So instead of taking away that choice and forcing everyone to navigate the internet the way they do, they should share their favorite method for opening links in new tabs so more people are aware of the option.

How is opening a link in a new tab disorienting?

For most browsers, when a link is opened in a new tab, there is no way to use the back button to go back to the previous page. It starts an entirely new history session in that new tab, and that may not be how they want to navigate.

Assuming they realized a new tab was opened and know how to get back, which is a little more complicated and sometimes harder to notice on mobile devices than on desktops, it’s not even guaranteed that they’ll return to your page. They might end up closing all tabs instead of just the one new one.

It’s even more confusing because on mobile Safari, I can sometimes hit the back button on a link that opened in a new tab and it will take me back to the website that opened the link, which almost seems like something they implemented to try to fix this user experience issue people have with links opening in new tabs.

Rather than have someone get lost in a sea of tabs, let them use their back and forward buttons and bookmark your page if they want to revisit it later. Give people a reason to come back rather than trying to trick them into keeping your site open to artificially inflate your analytics or because you’re too afraid they aren’t going to come back if they leave.

When is it okay to open links in new tabs?

The only universally recognized time you should be forcing links to open in new tabs is when you’ll potentially interrupt something that they can’t hit the back button to continue. Like a form being filled out, someone checking out on an ecommerce store, or if it would end someone’s logged in session.

There are some other times when it could make sense, but they will greatly depend on context:

  • Linking to a document like a PDF that doesn’t automatically download is a situation I put up less of a fight with. I go back and forth on whether files like these need to be opened in a new tab. I’ve seen websites that don’t force them to open in a new tab and am perfectly happy with how it works, but I can see the potential issues with it. You’ll need to provide information about the document you’re linking to, like a word or properly marked up icon telling whether it’s a PDF, Word Doc, etc.
  • External resources on a long page, reference page, or course. When navigating away from that page might be annoying if the browser doesn’t take you back to the same place on the page in the same circumstances. It depends on how you anticipate your visitors utilizing the page and what will make it easiest for them to navigate through.

If you do want to open a link in a new tab

Be clear. Warn people by either:

  • adding text to the link, for example: (opens in new tab)
  • adding a standard icon hidden to screen readers that displays the “opens in new tab” text on hover with screen reader text saying the same thing

If you’re using WordPress, the Accessibility New Window Warnings plugin makes this easy.

The Admin Bar’s accessibility weekly series has a great post on opening links in new tabs.

Opening a link in a new tab in WordPress

Once you’ve added your link, click the pencil to edit the link, click on “Advanced” to open the panel, and check the option for “Open in new tab.” The advanced panel should stay open for other links once you’ve opened it.

One of the common criticisms about the WordPress block editor is the amount of clicks it takes to do something. In this case, the additional click it takes to open the advanced tab means that you’ve acknowledged that you know what you’re doing and understand the implications of your choice.

This additional click means you have to actively want to do this instead of giving it the same weight as everything else. Rather than have too many options up front, we have the most important ones available and the others require some additional knowledge or context. It’s under “advanced” which means that some additional information is needed to make a decision about these settings. And once it’s opened, it stays open. One click to acknowledge you know what you’re doing.

Some SEO and other plugins enable the option to have all external links open in a new tab, which means you will be taking away that user choice, and every single link that doesn’t have your URL will open in a new tab. You still have to make sure it informs your users that the link opens in a new tab from a visual and screen reader standpoint.

The Bottom Line

Do what’s best for the people coming to your site. Help them find what they’re looking for, and give them a reason to stay.

Have you heard about the Nifty Evaluator for WCAG Testing?