Tuesday, October 13, 2015

How 2 Open External Links in New Tab in Blogger Blog

To prevent your blog readers from leaving your blog without reading any or only one post, you must think to open links from your blog in new tab. It also helps in increasing your overall page views and reducing bounce rate. Blog bounce rate is one of the important factors in blogging and is simply defined as number of readers leaving your blog without reading any or only one post. It means more the bounce rate lesser the engagement. When we consider reducing our bounce rate, the first thing our mind suggest is opening the links in new tab and its importance increases when it comes to external links.
This can be done manually for each link you want to open in new tab by by adding target=”_blank” inside hyperlink or in blogger editor when you are putting a link by checking the property Checkbox “Open this link in a new window”  as shown in below snapshot.

But this way may be a tough task if you have a enormous number of links to do this. So here I am giving you a simple jQuery script to open all external links in new tab.

Steps to Open all External Links in New Tab :

  • Go to your blogger dashboard
  • Select your blog >> Template
  • Backup your template before editing
  • Click on “Edit HTML”
  • Find </head> tag in HTML
  • Add the following piece of code just above the </head> tag
  • Save your Template, you are all done !!
Note : Please don’t add the red code if you already have jQuery library source code installed on your blog.

 <script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>
 <script type='text/javascript'>
 $(document).ready(function() {
 $("a[href^='http://']").each(
 function(){
 if(this.href.indexOf(location.hostname) == -1) {
 $(this).attr('target', '_blank');
 }
 }
 );
 $("a[href^='https://']").each(
 function(){
 if(this.href.indexOf(location.hostname) == -1) {
 $(this).attr('target', '_blank');
 }
 }
 );
 });
 </script>

Affected Links By Above jQuery Script:

Above jQuery script will check all hyperlinks inside your blog pages and will add the target=”_blank”  attribute to links which are external. It wont  put any effect to internal links of the blog. The script will only detect external hostnames and the moment it finds one, it will insert into the html a target attribute that tells the browser to open the link in a new window.

If this article helped you, please take some time to like and share it. You can subscribe us by your email to make every post delivered to you directly in your inbox.

Monday, October 12, 2015

Make all the link in Blogger to Open New Tab

You guys might already know the way to open in new tab/window. A simple link looks like this;
Himalayan Tech
If you click on the above link it will open in new window. It is how, most of the links are. But these links doesn't allow the visitors to view our post and the site linked by the link at same time as both pages loads in the same tab.
 
 
 
But by adding [target"mynewwindow"] attribute we can open a link in new tab.
If you click on the above link, you browser will open the site in new tab/window. In doing so it will allow the users to view multiple sites.

Now, Making All Links To Open In New Tab;

It is quite easy. If you want to make all of the links in your blog to primarily open in new tab then follow below steps;
  1. Go to your dashboard.
  2. Be forwarded to template>Edit Html.
  3. Search for </head> tag.
  4. After you found it paste the below code just above it;
<base target="_blank" />
Now your all links will open in new tab. ENJOY!!

Featured Post

Carlos Vela's future is among the 14 roster riddles LAFC is trying to solve

LAFC general manager John Thorrington has just six weeks to rebuild a roster that has lost 18 players, and it's unclear if Carlos Vela...

Popular Posts