Ok! Try this code, this will make all links add target="_blank" on load of the page

PHP Code: 
<html>
<
head>
<
title>Add target _blank in all Links by Javascript</title>

<
script type="text/javascript">
window.onload=addtargetblankinalllinks // add the function on load of the page
function addtargetblankinalllinks() {
var 
links document.getElementsByTagName('a');
for(
i in links)
    
links[i].target="_blank";
}
</script>

</head>
<body>
<a href="http://www.dl4everything.com">DL4EVERYTHING</a><br />
<a href="http://www.soft2050.in">Soft2050</a><br />
<a href="http://www.google.com">Google</a><br />
<a href="http://www.yahoo.com">Yahoo</a><br />
<a href="http://www.facebook.com">Facebook</a><br />
All Links will open in new tab even the links don't have any target _blank
</body>
</html> 
Eg Link for testing: http://pastehtml.com/view/bmbwg4vvx.html
soft2050 Reviewed by soft2050 on . PHP/Javascript: Make certain links open in a new window? Does anyone know a code for making a certain link open in a new window automatically? I know I can do this manually but I probably have over 1000+ links in my blog that doesn't have a target="_blank" tag. Rating: 5