How to Open External Links in a New Window or Tab with WordPress
@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.
Most other plugins perform a hack by altering the target parameter (i.e. <a href=”http://somewhere.example” target=”_blank”>). That method is not XHTML Strict compliant.
How to automatically open external links in a new tab with WordPress
We use (and love) WordPress here at BestTechie, it has been our content management system of choice since 2006. That’s a long time. I’ve been using WordPress’ new Gutenberg editor to create content and there’s one thing I found to be a bit finicky in the new editor: setting external links to open in a tab. After becoming frustrated enough with it I decided to figure out a way to have WordPress automatically open all external links in a new tab.
How to set links to open in a new window/tab in wordpress
An avid blogger with a passion for WordPress, blogging, SEO and social media. My goal is to supply you with the right information to help you succeed with your wordpress blog. Circle him on Google+