WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have author pages for each author and I want to see all of their comments (or all of their recent comments) if I click on their nickname. How can I do this? I tried the beneath code, but that does not show the unique comments per user... It just outputs all recent comments from everyone combined, but I don't want that.

$author_email = get_the_author_meta( 'user_email' );
$args = array(
    'author_email' => $author_email,
    'number' => '10'
$comments = get_comments($args);
foreach($comments as $comment) :
    echo('<li class="comment">' . $somment->comment_content),'<h5><a href='.get_permalink($comment->comment_post_ID).'>', get_the_title($comment->comment_post_ID), '</a></h5>', '<time><em>' . $comment->get_comment_date . '</em></time>', '</li>';


share|improve this question
up vote 4 down vote accepted

http://codex.wordpress.org/Function_Reference/get_comments#Parameters your problem is using author_email, you need user_id

i just use similar script.

    $args = array(
        'user_id' => $user->ID,
        'number' => 10, // how many comments to retrieve
        'status' => 'approve'

    $comments = get_comments( $args );

    if ( $comments )
        $output.= "<ul>\n";
        foreach ( $comments as $c )
        $output.= '<li>';
        $output.= '<a href="'.get_comment_link( $c->comment_ID ).'">';
        $output.= get_the_title($c->comment_post_ID);
        $output.= '</a>, Posted on: '. mysql2date('m/d/Y', $c->comment_date, $translate);
        $output.= "</li>\n";
        $output.= '</ul>';

        echo $output;
    } else { echo "No comments made";}


share|improve this answer
Life saver! Thank you Andy, much appreciated. – user1627363 May 15 '13 at 9:08

Check This Show Comments by User ID in WordPress

share|improve this answer
Nope... It doesn't show a thing. – user1627363 May 15 '13 at 8:26
Thanks for the effort though – user1627363 May 15 '13 at 9:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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