Open Links in a New Window – Why and How

Open Links in a New Window – Why and How

Wait, where’d it go?!  It was just here!

These are phrases you never want users of your website to think.  But when a user clicks a link on your site and is kicked to a third party site without opening a new window or tab, you’re setting them up for frustration.

Here are some tips on when you should open links in a new window and how to do it on your website.

A Quick Note on Browsers

Whether a page opens in a new window or a new tab is dependent on each individual user’s settings.  For the most part, modern browsers open pages in a new tab instead of a new window by default.  Some older browsers are the opposite and open in a new window instead of a new tab.  Since that’s largely out of your control as a website administrator, I’m using “new window” and “new tab” interchangeably throughout this post.  Just want to make sure we’re all on the same page.  So where were we…

Why Open Links in a New Window?

The main reason is simple: you want people to stay on your website.  If a user clicks a link on your website and is taken off your site, there’s not a great chance they’ll take the time to navigate back.  Sure, they may hit the Back button in their browser or retype your URL.  But that’s all extra work for your user.  It’s hard enough to get an interested visitor to your website in the first place.  You should try to make their lives as easy as possible once they’re on your site.

Is It Ever Appropriate to Open a Link in the Same Window?

Of course it is.  The idea of opening a link in a new window is not by any means a hard and fast rule.  The best way to figure it out is to view each page with your user in mind.  If you were a visitor to your website, would you expect the link to open in a new window or in the same window?

As a general rule, if the link is taking a user to another page on your website it should probably open in the same window.  If a link is taking a user off your site, open it in a new window.

How to Open Links in a New Window

Since the nuts and bolts of how to open a link in a new window vary widely based on the way your website is built, I’ll focus on how to do so in the most popular content management system out there, WordPress. We’ll also throw in good ol’ fashion HTML just for good measure.

Open Links in a New Window in WordPress

To open a link in a new window in WordPress, all you need to do is make sure you check the box beside “Open link in a new window/tab” when adding your link.  It’s that simple.  Now, as the name implies, your link will open in a new window or tab.Open Link in New Window WordPress

Note: I’m using WordPress Version 3.3.1 for this demo.  In an older version of WordPress your dialogue box likely will look different.  If you see a dropdown menu, select the option that says “Open link in a new window” to achieve the same goal.

Open Links in a New Window in HTML

Chances are if you’re writing HTML you know how to do this, but I want to make sure I’ve got my bases covered.  To get those links opening in a new window all you have to do is add a little code.

Original Link (opens in the same window)

<a href="http://www.wordpress.org/">WordPress</a>

Resulting Link: WordPress

New Link (opens in a new window once you add target=”_blank”)

<a href="http://www.wordpress.org/" target="_blank">WordPress</a>

Resulting Link: WordPress

Your link will now open in a new window.

Share Your Thoughts

What do you think?  As a user, do you like or hate when links open in new windows?  As a website administrator, do you tend to open your links in the same window or in a new one?  We’d love to hear your thoughts.