How to open all external links in New tab

How to open all external links in New tab


How to open all external link of blogger to new tab 

To open all external links in new tabs in Blogger, you can follow these steps:


1. Go to your Blogger dashboard and select the blog you want to edit.

2. Click on the "Theme" section in the left sidebar and then click on "Edit HTML."

3. Before making any changes, it is always a good idea to back up your template. Click on "Download full template" and save it to your computer.

4. In the HTML code, search for `</body>` tag using CTRL + F and paste the following code just above it:

5. Dont forget to chenge example.com with your domain name without https 




code for new tab opening



 
<script type='text/javascript'>
// <![CDATA[
function externalLinks() {
for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) {
var b = c[a];
b.getAttribute("href") && b.hostname !== location.hostname && (b.target = "_blank", b.rel = "nofollow")
}
}
externalLinks();
// ]]>
</script>


Next Post Previous Post
No Comment
Add Comment
comment url