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

  • Fake ID Card Generator For Facebook Verification
    In this blog we had briefed different reasons why your Facebook ID is getting temporarily locked. Facebook Security automatically lock d...
  • How To Make Responsive Images For Blogger
    Have you a Blogger blog? If yes, are you using responsive images into your Blogger posts? If no, read this post to make any image from yo...
  • How To Create a Google+ Community for Blogger
    Do you want to create a Google+ community for your business or blog? Here is a simple guide. The very first thing before creating a G...
  • How To Change SEARCH BOX For Blogger
    For every Blogger template , there is a Search Bar . Some times this search bar will be useful , some times not. And this search bar ...
  • AdSense achievement card
    The most popular and leading legit advertising platform is Google AdSense where billions of people earning money by monetizing their...
  • How to change facebook group name after 5k members
    HOW TO SETUP FACEBOOK GROUP then read this article. You can only change the name of Facebook group if you are the admin of that GROUP and...
  • YouTube Support in Blogger
    Blogger allows you to upload your own videos via the Blogger Post Editor. It also allows you to embed YouTube videos into your posts(...
  • How to Find Skype Contacts
    Calling Skype contacts is easy, but before you can call them, you have to find them. Fortunately, Skype’s search page makes finding ...
  • Why PIN Hold appear on New AdSense Account
    While using AdSense Account then you should know well the terms and conditions of AdSense . Because there are several terms and con...
Template by Malik HassanHome - Sitemap - Privacy Policy - Terms And Conditions - Disclaimer - Author