]> Open comment authors website link in a new window | Web Developer Reference Blog

Open comment authors website link in a new window

When a user posts a comment on your blog, they are given the option to have their name linked to their own website by supplying the URL when they post. To make these links open in a new window:

find in wp-includes/comment-template.php (~line 148):

$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";

replace with:

$return = "<a href='$url' rel='external nofollow' class='url' target='_blank'>$author</a>";

And that’s it. If you have difficulties implementing this, contact me for paid support.

Tags: Basics, Comments, Wordpress

3 Responses to “Open comment authors website link in a new window”

  1. Thanks a lot, it was a great help and work well !!!

  2. Will Craig says:

    Glad the information was of use to you

  3. Really, man thanks for this. Found this article here after a lot of old and outdated. I just updated my blog with target-”_blank” on the comment author URL. Works great (WordPress Version 3.2.1).

Leave a Reply