One thing i learned today that it pays to look behind all the things you did. And as I was looking on a website i created it is a social website, I remember I placed a code, a javascript code that will seek all the anchor and check if those are links outside my website and if yes , then i set the target of it to “_blank” . It is very helpful code that solves my problem with a client in a very quick minutes. I would like to share it also with you guys.

Here is the code:

1. You need to put this block of javascript in the footer part of the html , that is, if you are using cms like wordpress , most likely you will put this piece of code in the footer.php file.

2. Before we start to harm any files in our website, let us do the golden rule first, backup the file.

3.  Then we will start adding this block of code before the end of the body tag (</body>) . Replace ‘yourdomainhere’  with your domain :p . Example :   my domain is  http://www.sherkspear.com   so i’ll replace ‘yourdomainhere’ with ‘sherkspear’.

4. Then save the file and update your website.