This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Get Author's Comments


This plugin allows to display or retrieve comments posted by a user. In order to avoid homonyms, a user is identified by his name and email(s).

Note: Get Author’s Comments uses the function wp_list_comments introduced by WordPress 2.7 for the (x)HTML output.


Display all comments of a specific user in the current post

        <?php ppm_author_comments('piouPiouM', ''); ?>

or, if piouPiouM wrote with two different emails:

        <?php ppm_author_comments('piouPiouM', array('', '')); ?>

Display all comments posted by a user

        <?php ppm_author_comments('piouPiouM', '', null, 'all=1'); ?>

Display comments wrote by a user in the post of ID number 9

        <?php ppm_author_comments('piouPiouM', '', 9); ?>

Note: If you used the tags ppm_author_comments or ppm_get_author_comments whithin The Loop, the parameter $postID will be replaced automatically by the numeric ID of the current post.

Lastest comments ordered by post_ID

To show the last ten piouPiouM’s comments sorted by post_ID in ascending order, the following will display their comment date and excerpt:

    $comments = ppm_get_author_comments('piouPiouM', '', null, 'number=10&order=ASC&orderby=post_id');
    foreach ($comments as $comment):
<p><cite><?php comment_author_link() ?></cite> says:</p>
        <p>Comment posted on <?php comment_date('n-j-Y'); ?>:<br/></p>
        <p><?php comment_excerpt(); ?></p>
<?php endforeach; ?>

Comments with a custom comment display

        <?php ppm_author_comments('piouPiouM', '', null, 'callback=mytheme_comment'); ?>

See Comments Only With A Custom Comment Display for an example of a custom callback function.

Show the total number of comments posted by a user on the site

    $comments = ppm_get_author_comments($current_user->display_name, $current_user->user_email, null, 'all=1');
    printf('Hello ! <a href="/author/%s/">%s</a>! '
         . '[ <a href="%s" class="logout">Log Out</a> ]<br/>'
         . '%d posts and %d comments',

(boolean) (optional) Retrieve all comments. Default to FALSE.

(integer) (optional) Number of comments to return. Default to None, returns all comments.

(integer) (optional) Offset from latest comment. Default to 0.

(string) (optional) Sort posts by one of various values (separated by space), including:

  • 'comment_ID' – Sort by numeric comment ID.
  • 'content' – Sort by content.
  • 'date' – Sort by creation date. (Default)
  • 'post_ID' – Sort by post ID.
  • 'rand' – Sort in random order.
  • 'status' – Sort by status.
  • 'type' – Sort by type.

(string) (optional) Sort order, ascending or descending for the orderby parameter. Valid values:

  • 'ASC' – Ascending (lowest to highest).
  • 'DESC' – Descending (highest to lowest). (Default)

(string) (optional) How you’d like the result. Only for ppm_get_author_comments.

  • OBJECT – Returns an object. (Default)
  • ARRAY_A – Returns an associative array of field names to values.
  • ARRAY_N – Returns a numeric array of field values.
  • HTML – Returns a (x)HTML version generated by wp_list_comments.

(string) (optional) The comments status. Default to hold and approve. Valid values:

  • 'hold' – Unapproved.
  • 'approve' – Approved.
  • 'spam' – Spam.


Get Author’s Comments is installed in 3 easy steps:

  1. Upload get_authors_comments.php to the /wp-content/plugins/ directory.
  2. Activate Get Author's Comments through the Plugins menu in WordPress.
  3. Add in your theme:

    <?php if (function_exist('ppm_author_comments')): ?>
            <?php ppm_author_comments('name', 'email', 'post_ID', 'args') ?>
    <?php endif ?>


There are no reviews for this plugin.

Contributors & Developers

“Get Author's Comments” is open source software. The following people have contributed to this plugin.




  • Support a new all argument for retrieves all comments posted by a user.
  • Add changelog and additional examples.


  • The arguments are case insensitive.
  • Support of two new orderby arguments: comment_ID and post_ID.
  • Set default orderby argument to date.


  • Initial release.