Open Posts in New Window

Is there a hack or option for the Recent Global Posts Widget I can use to make posts open in a new window when a user clicks on a link to a post? I generally set all external links on my blogs to open in a new window and I would like to treat links in the Recent Global Posts Widget the same way.

I'd also like to hear your thoughts on whether or not you think this is a bad idea from a usability or SEO perspective.


  • Mason


    The only way to do this would be to hack the plugin a little. It's not a complicated thing to do - but you would need to note the changes as they would be removed anytime you updated the plugin.

    That being said, it's pretty straight forward.

    Add the following:
    immediately before the closing bracket > for lines 186, 190, 194, and 197.

    For example line 186 will go from this:
    echo '<a href="' . $post['post_permalink'] . '">' . get_avatar( $post['post_author'], $options['recent-global-posts-avatar-size'], '' ) . '</a>';
    to this:
    echo '<a href="' . $post['post_permalink'] . '" target="_blank">' . get_avatar( $post['post_author'], $options['recent-global-posts-avatar-size'], '' ) . '</a>';

    I don't know of any SEO reasons pro or against doing this and it's often nice to let folks know they're leaving your site - I personally use it as little as possible. When I find a website has done it needlessly, I feel a kitten probably dies somewhere. :wink:

    Anyway, hope this helps!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.