Open all the External Links in a New Window Automatically in Blogger
Why I'm writing that :
Many blogger users have a problem , and its that the external link open in the same tab and that give a high Bounce Rate cause it get the visitors out .
So to solve this problem we need to add a code on our template HTML , that code will open all the external links in a new tab . It's an important code !
Learn how to add it :
In your blogger dashboard go to Template then Edit HTML after that hit CTRL+F and search for <head> ,
you can found it without using those buttons cause it will appear on the top of HTML , anyway add the code below under <head>
<!-- start of external links new window -->
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function () {
$("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").attr("target","_blank").attr("title","Opens new window").addClass("external");
});
</script>
<!-- end of external links new window -->
Then Save the template , now all is OK .
MY LAST WORDS :
Thanks for reading that , i think that will help you , so share with the others and comment if you like or if you had a difficulty , i am here to help you .
Many blogger users have a problem , and its that the external link open in the same tab and that give a high Bounce Rate cause it get the visitors out .
So to solve this problem we need to add a code on our template HTML , that code will open all the external links in a new tab . It's an important code !
Learn how to add it :
In your blogger dashboard go to Template then Edit HTML after that hit CTRL+F and search for <head> ,
you can found it without using those buttons cause it will appear on the top of HTML , anyway add the code below under <head>
<!-- start of external links new window -->
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function () {
$("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").attr("target","_blank").attr("title","Opens new window").addClass("external");
});
</script>
<!-- end of external links new window -->
Then Save the template , now all is OK .
MY LAST WORDS :
Thanks for reading that , i think that will help you , so share with the others and comment if you like or if you had a difficulty , i am here to help you .
