SkyUrdu | The Largest Hub Of Tutorials
Select Menu
  • Home
  • Google Adsence
    • Google Adsence Tricks
    • Supports Languages
    • 11 Tips For Adsence
    • 12 Tips For Adsence
    • 100% Approval Tip
    • Achievement Card
    • Adsense Revenue
    • Verify Account
  • Make Money
    • Earn With Bidvertiser
    • Earn With Freelance
    • Earn With Blogging
    • Earn With You Tube
    • Earn With Ads Cash
    • Earn With Adsence
    • Earn With Infolinks
    • Earn With Typing
  • Blogging
    • 404 ERROR Page
    • Google+ Fallow
    • BackUP/Restore
    • Mobile Templet
    • Custom Domain
    • Blogger Tricks
    • Custom Fonts
    • Templetes
  • SEO
    • Google Algorithm
    • Google Analytics
    • Select Keywords
    • Blogger Vistors
    • Alexa Ranks
    • Robots.txt
    • SEO Tricks
    • SEO Tools
  • Social Media
    • Whatsapp
    • Facebook
    • Pinterest
    • Google+
    • Twitter
    • Skype
    • Imo
    • VK
  • Networks
    • Easypaisa
    • Mobicash
    • Mobilink
    • Telenor
    • Warid
    • Ufone
    • Zong
  • Much More
    • How To
    • Much More
Home » How To » SEO Tricks » How TO Open All Links in New Tab For Blogger

How TO Open All Links in New Tab For Blogger

Unknown
Add Comment
How To, SEO Tricks
Do you want your visitors stay on your site for a long time? Read more articles instead of just one page? An easy solution is to create target="_blank" to each of your external links so that when a user clicks on your external links your webpage remains open while the external links open in the new tab. To do it, you have only two options either you can create it manually, including target='_blank' in each external link's html tags, or you can create it automatically by using the following script in your blogger. The following script will add target='_blank' to all of your external links automatically that means all the external links will now open in a new tab in your blogger blogs. I have also included the parts by which you can make a rule to open all of your internal links or both links (internal and external) in new tab. Let's talk about the advantage when using all the external links to open in new tab.

Advantage: Open All External Links in New Tab

  • "Daily time on site" will be increased.
  • "Daily pageviews per visitors" will be increased.
  • Bounce rate improvement.
If you want to use manual method, go to your post editor, and while creating your link just checking the checkbox of "open this link in a new window" as show in the following preview. Once you check the following box this property will add another attribute target="_blank" to your hyperlink tag.

how to open external links in new tab
However, there are few solutions which allow us to add target="_blank" attribute automatically on each links contained in the blog posts. You can make your all external links to open in new tab or all internal links to open in new tab or you can also make this rule for all of your internal and external links. We'll discuss it for each case.

How to Open All External Links in New Tab

To open all the external links in new tab, we'll use a jQuery script.

Go to your Blogger Dashboard -> Select your Blog -> Template -> Edit HTML. Now, click anywhere in the code and open the search box using Ctrl + f, and find </head> code. Now, copy the following code and paste just above to </head> code.

Note: Don't add the red line code which is a jQuery library code, if your blogger template already using it. You can easily checkout by using a search if your template already contained it.


<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>


Since, while using external links either you can use 'http' version of a site or 'https' version of a site so we have added both version. The above jQuery script will work on each of your external links only. It would not affect any internal links inside your blog. Whenever the script finds any external link inside your blog, it will automatically add a target attribute with the value of '_blank'.

How to Open All Internal Links in New Tab

What if you want to open all of your internal links (except external links) in new tab, Just use the following jQuery script instead of the above script.

Note: Don't add the red line code which is a jQuery library code, if your blogger template already using it. You can easily checkout by using a search if your template already contained it.

<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>


Now, the above jQuery script will detect all the internal links inside your blog, and adds automatically target attributes with the value '_blank'. The current script would not affect any external links.

How to Open All Internal & External Link in New Tab

To open all the external & internal links in new tab, follow simple steps.

Go to your Blogger Dashboard -> Select your Blog -> Template -> Edit HTML. Now, click anywhere in the code and open the search box using Ctrl + f, and find </head> code. Now, copy the following code and paste just above to </head> code.

<base target='_blank'/>

Once you added this code to your blogger template, all the internal and external links will now open in new tabs. However, you may want to open few links in the same tab. To do it, just add an additional attribute, target="_self", while creating your link in blogger post editor HTML tab. i.e., <a href='your link' target='_self'>your text</a>.

Conclusion: Open external links to new tab might improve your bounce rate, time on site and pageviews. I have added the easiest way to handle it automatically. You can share your thought by the following comments.
Share This!--- Facebook Twitter Google+

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Search Hare

Populer Posts

  • Money Transfer By MobiCash
       Now it just takes a few moments for you to transfer money to your family, friends or business partners using services of Mobicash. Any...
  • How to Add Font Awesome 4.5 in Blogger Template?
    Hi guys…We are already aware about fantastic Font Awesome which use a pictographic techniques to display icons instead of image. This is...
  • Facebook send button for Blogger
    It had been some time since Facebook released their new Send Button. The Send button is a social plugin that websites can use to let p...
  • Blogger Lab Full Width Version Responsive Blogger Template
    After successful response from user I have released today Blogger Lab v1.1 and also releasing Blogger Lab Full width v1.1. I hope thi...
  • Best Free Proxy Servers List 2016
    Sometimes you may face problem while accessing some websites either it says this webpage is not available or this website/url has been bl...
  • H1,H2 & H3 heading tags in Blogger
    Heading tags are a way of organizing and prioritizing content in a HTML document. There are 6 heading tags – H1 (the most important one) ...
  • How To Create A SEO Friendly robots.txt in Blogger
    Do you want to create your own robots.txt file for your Blogger? If yes, this post will guide you in easy steps. Here I will discuss ...
  • Best Top 3 Blogging Sites To Make Money Online
    WordPress.com WordPress is the best choice of Bloggers to make money online. Almost everything is free on WordPress. it is providi...
  • Essential Traffic Sources For Your Brand New Blog
    blog traffic is not as easy as it appears. It is in-fact harder to get blog traffic than it is to get regular website traffic. So, your qu...
Template by Malik HassanHome - Sitemap - Privacy Policy - Terms And Conditions - Disclaimer - Author