Whenever a user presses on a comments author it redirects the user to the site which was enetered by user. I just want to add the target="_blank" element. where I can modify this?

In file i see only this: get_comment_author_link()


You would have to use the get_comment_author_link filter for this in the following manner.

add_filter( "get_comment_author_link", "wpse_63316_modifiy_comment_author_anchor" );
function wpse_63316_modifiy_comment_author_anchor( $author_link ){
    return str_replace( "<a", "<a target='_blank'", $author_link );
  • Just tested this solution and longer works. – Dev May 19 '17 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.