How to Make Links Open in a New Window

Today Darren Rowse from Problogger asked his readers: What do you know know about blogging that you wish you knew when you started?

My answer: I wish I knew to make links open in a new window. The reason why this is important is that making links open in a new window ensures that when someone clicks an external link on your blog they don't leave your blog for good. This helps your reader return to your page without having to repeated click their "back" button.

Wondering how to do this?

It's not difficult. It varies a bit depending on the blogging platform you use, but generally it goes like this:

1) you highlight the words that you want to make into a link (just like always)

2) you indicate by clicking the little link icon that you want to make the words or address into an active link (just like always)

3) a window opens up and asks you for the complete URL for the link (just like always)

3) you type in the complete URL and then before you click "OK" look for a button that says "target"

4) click the "target" button and then click "new window" or "blank"

Now when someone clicks a link from your site, the link will open up in a new window. When they finish looking at that site, they'll click "close" and be taken back to your site. That way you don't lose visitors.

If the blogging platform you use doesn't provide you with the "target" button, you can add the html code target="_blank"

So if you have a link that looks like this:

href="http://www.interestingsite.com/relevantarticle.htm">

you just add the html code right before the >

So it ends up like this (I've added the bold for emphasis; you don't need to do that)

href="http://www.interestingsite.com/relevantarticle.htm"target="_blank" >

Note added June 26, 2007: Seems my instructions on how to open a link in a new window stirred up quite a bit of controversy with Problogger readers. Apparently some people find it annoying when websites are set up to open links in new window. There's strong opinions on both sides of the issue. For now, I'll continue my practice of opening links in a new window (tab) but I will take the opposing opinions under consideration.

1 Comments

SonDan said:

Thank you very much. I was looking for the code to do this.

Leave a comment


Type the characters you see in the picture above.


 
 

Search for info