comment_author_link()WP 0.71

Display the html link to the url of the author of the current comment.

No Hooks.


null. Nothing (null).


comment_author_link( $comment_id );
WP_Comment or the ID of the comment for which to print the author's link.
Default: current comment



#1 Display the name of the current commenter as a link to his page:

This will print author’s link with anchor tag.

<?php echo comment_author_link(); ?>

Output will:

<a href="" rel="external nofollow" class="url">Author Name</a>

Use comment_author_url(), if you want to get only comment author’s url.


Since 0.71 Introduced.
Since 4.4.0 Added the ability for $comment_id to also accept a WP_Comment object.

comment_author_link() code WP 6.5.3

function comment_author_link( $comment_id = 0 ) {
	echo get_comment_author_link( $comment_id );