In WordPress every time an author wants to add a link in a post they have the option of selecting “open link in new window”. Although doing it manually is an option, there is a better way. By using this plugin you can have all external links open in new windows automatically even if someone forgets to check the box.

All you have to do is go and download the plugin. There is no back end so you do not have to worry about setting anything up in the admin panel. Once you have activated it every link will be opened in a new window using JavaScript’s window.open()-function. Not only is this SEO friendly but the code is also XHTML Strict compliant. The best part about this plugin is that when Javascript is disabled in someones browser it doesn’t return any errors but just remains inactive.
Download the plugin Open External Links in a New Window.







I think it is much easier to just handle this in the jQuery for the whole site… and never worry about it again. (Substitute your own domain name for mine, of course.)
// open all external links in a new window
$(“a[href^='http']“).not(“[href*='demeyere.com']“).attr(‘target’,'_blank’);
@demeyere Again, the plugin above is not using target _blank to make sure that the site validates with XHTML strict. But yes, your code will do the job as well.FYI for others reading: Now anyone can simply make a plugin and call this snippet in the header. It wouldn’t make any difference in the load time between you manually putting in your header or calling it via a plugin into wp_head() hook.
Hi
In earlier versions of wordpress, you selected the text you wanted to link to and then hit the link icon on the dashboard.
This opened a field in which you added the link.
Worked fine.
In latest wordpress versions, when I select the text and hit the link icon and paste in the link, the link appears at the top of the post – not surrounding the selected text.
Am I doing something wrong?
Plugin looks good but I’m trying to cut down on the number that I use.
@easyP It doesn’t work like that on our site. We are using 3.2.1. We select the text and hit the link icon, and it adds the link where it should. Are you using the Visual Editor or the HTML Editor?Also, any particular reason why you are trying to cut down on the number of plugins that you use?
@wpbeginner
Hi boys.
Number of plugins – trying to cut down because of page load time.
I love my theme, but it runs like a donkey.
I use the html editor when writing posts and I’m using wordpress 3.2.1 but when I select the text and hit the link icon – the link forgets the highlighted text and appears at the top of the post / page!
Any thoughts?
@easyP If you try to this trick without a plugin, you will end up doing the same thing. The impact of this plugin on your load time is barely noticeable.
@wpbeginner
Worth knowing that – thanks boys.
I just installed this plug-in. Kind of a funny name, Open External Links in a New Window, but certainly a great idea. Thanks!