Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Instead of using a link target which breaks XHTML 1.1 validity, you can create a popup link using jQuery.
To do this, you can use XPATH in jQuery functions
Now, in your template file (e.g. node.tpl.php) insert this code:
drupal_add_js('
$(document).ready(function(){
$("a[@href^=http:]").click(function() {
window.open(this.href);
return false;
});
});', 'inline' );
Now all external links on your site will pop up in a new window, but internal links will not be affected, provided they are not programmed with "http:" in front of them (most Drupal automatic links are not).