In my last post, I asked whether links should open in new tabs or not.
While I was thinking that most people like links in same tabs, more people voted and commented in support of new tabs. So, I have decided to make external links on Blogging With Success open in new tabs for now.
In this tutorial, I will discuss different methods of making a hyperlink open in new tab.
WordPress offers following ways to open links open in new tab:
Doing it manually takes time but is fine since you have complete control over the links that should open in new tabs and the ones which should not. To make links in your post open in new tab, use the following steps.
- When writing post, once you have written the link text, click the "Insert/Edit Link" button in editor. A popup like following will open:
- Enter the address of target page. For example, if you want to link to Blogging With Success, enter bloggingwithsuccess.net in URL field.
- Now, click "Target" drop down and select "Open Link In New Window".
- Click Insert.
That will do the job for anything included in posts.
However, manual method is a big problem if you have a big archives or have sidebar widgets pointing to external pages.
But in that case, we have......
It has been quite some time since I wrote about WordPress Plugins. Isn't it?
But since plugins can make the task easier for you, here are some options:
- Open In New Window Plugin: Similar to JAB plugin. However, it is listed as WordPress 3.1 compatible while JAB is not. May work if JAB does not.
- Open External Links In A New Window: This plugin claims to do the things differently. Excerpt from plugin page: Most other plugins perform a hack by altering the target parameter (i.e. < a href="http://somewhere.example" target="_blank" >). That method is not XHTML Strict compliant. This plugin handles the links client-side, which lets search engines follow the links properly.
Blogger And Other Platforms
I tried Blogger but looks like there is no easy method. So, you will have to edit some code. However, it is very simple.
Once you have finished editing your posts, go to HTML view. The code looks like following:
<a href = "http://bloggingwithsuccess.net">Blogging With Success</a>
Where, Blogging With Success is anchor text and link points to http://bloggingwithsuccess.net/
If you want to make link open in new tab, just add target = "_blank" after URL. For example, above link will become:
<a href = "http://bloggingwithsuccess.net" target = "_blank">Blogging With Success</a>
That should do the job.
Any questions? Feel free to ask in comments.
Do not forget to share this post.