Open All External Links in New Tab in Blogger

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='' type='text/javascript'></script>
 <script type='text/javascript'>
 $(document).ready(function() {
 if(this.href.indexOf(location.hostname) == -1) {
 $(this).attr('target', '_blank');
 if(this.href.indexOf(location.hostname) == -1) {
 $(this).attr('target', '_blank');

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.

Different scenarios of links either Internal or External in Your Blog to Open either in New Tab or in same tab :

If you want to manage all or some of links or links from Blogger LinkList Gadget in multiple cases, then must go through the brief article which describes various such scenarios in it is following :

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.

Vikas is an internet geek and founder of Technotraps, a modern tech website. He is a passionate blogger and love to share latest tricks & informations about technology.

  • Thank you for this nice info, really help

  • maria noor

    Thank u sir its really helpful

  • Thank you so much! You made it really easy to follow=)))

  • thank you :)

  • Thank you so much… this was extremely helpful. Keep up the good work.

  • WebPresence

    thank you brilliant and simple to follow, have posted your blog to my pinterest page as well

  • DJZapApple

    Thank you so much!

  • Thanks, this worked great!

  • Lafuan M

    Thank you, Sir.. It’s worked

  • Kavita Krishnamorthi

    worked like magic! thank you

  • Marie Torro

    It works! Thanks!

  • hi Vikas, I want to add external link to each Read More button for every post seperately. How to do this. by default it is posts title, I want to use it to direct post to external page.

    Say if you have post grid with “read more” button for each card. How to link that read more to seperate external link?

    Please help. Daniel

  • Jaafar Husin

    Thanks Vikas. You’re awesome.