Open External Link in New Tab

You can open external link in new tab with few lines of jQuery. Make sure the jQuery library is loaded. The following script tests if the site and href domain is same. If not, link is open in new tab.

Note: It is better to load scripts in footer.