WordPress Top Commenters Plugin / Widget

This plugin will add a list of the most frequent commenters posting to your blog. They are gathered in descending order (highest number of comments at the top) The list items will be links to the comment author’s URL, if provided.

The following parameters are configurable by the user, either from the widget admin interface or directly (if used as a standalone plugin):

  • Number of people to show
  • List of names to exclude from the list: An array of names to be ignored from the counts.

Download FreePress Top Commenters Widget

Installation:

  1. Extract all files in the archive into your plugins directory. The archive should contain a folder called “freepress”, which should be placed directly under the plugins directory, and all the files distributed with this plugin should be in the “freepress” folder. For example: /var/www/wordpress/wp-content/plugins/freepress/topCommentersWidget.php
  2. If you are using the widgets plugin, the tagboard will automatically appear as an available widget for your sidebar.
  3. If you prefer to manually add the tagboard to your theme, you can insert the following code wherever you’d like the tagboard to show up:

    If you wish to manually specify the arguments listed above, add them in the order listed. The number of people to list will default to 10, and the names to exclude will default to an empty array (which will include all commenters).

*Note: This version of the plugin has been tested in WordPress 2.x as well as recent versions of WordPress MU. Please let me know by commenting here if you run into any issues.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

92 Responses to WordPress Top Commenters Plugin / Widget

  1. wuti says:

    Great widget! I’m using it in my blog, and this is the plugin I cannot find until now, thank you!

  2. JB says:

    Cool! Good to hear it’s working well for you.

  3. Boo Radley says:

    Wonderful plugin, thank you :-)

    I was just wondering how to write the people I want excluded.

    e.g. let’s say I want to exclude “Boo Radley” and “David”

    I tried echo fp_get_topcommenters(8, “Boo Radley”, “David”);

    but it doesn’t work

  4. JB says:

    Thanks for the feedback!

    The names to exclude parameter is an array value, so for the example you cited, you should be able to use:

    echo fp_get_topcommenters(8, array("Boo Radley", "David"));

  5. Boo Radley says:

    Thanks for your reply JB

    I entered this exact code now:

    but if you look at my blog you’ll see that the two names still show up. Any ideas how i can fix that?

    Sorry for bothering you

  6. JB says:

    Oops, my bad. Looks like that was a bug in that version.

    I’ve just fixed it and reuploaded, so if you download this new version it should be fixed.

    Sorry about that.

  7. Boo Radley says:

    Works like a beauty now
    Thanks :-)

  8. aseed says:

    I need i find thank very mutch :-)

  9. patung says:

    I’m actually trying to find a plugin that does something similar to yours but instead links to a page that lists all the comments that each listed person has made on the blog, would your plugin be modifiable in this way?

    Thanks.

  10. Pingback: BloggingPro China » Blog Archive » WordPress Widget: Top Commenters Plugin / Widget

  11. Pingback: Bloggy Widgets » Blog Archive » Top Commenters Widget

  12. Pingback: Zealios[dot]Net » Blog Archive » Top Commenters Plugin.

  13. Pingback: Changing Comment Policy

  14. Laslo says:

    Hey great plugin, got it working on my blog.

    just to let you all know I added a couple of restrictions, so the top commenters list wont show trackback nor pingbacks

    “WHERE comment_approved = ’1′ AND comment_author != ” AND comment_type != ‘pingback’ AND comment_type != ‘trackback’ “;

  15. Jinge says:

    I run the Tiga-theme on my blog and the plugin works really nice. But I have a problem when I use IE. The font size is ok in FF but in IE it seems like the post name is far to big. Why is that and what can I do?

  16. Pingback: Increase Comments to your Blog with Top Commenters Widget - Flee the Cube

  17. Robin says:

    I LOVE this plugin because I think it’s nice to show the regular commenters.

    I just switched to widgets (to make blogging a bit less stressful) and it isn’t showing up as a widget. I tried to add the code you suggested and it isn’t working.

  18. Robin says:

    Ok I got the widget to work but I would like to edit it so it’s monthly and to have the number of posts right next to the name. Is that possible?

  19. JB says:

    Yes. When you say monthly, do you mean only showing stats for the current month, or showing historical info for the last X months?

    The first one would be a pretty easy addition to the SQL that is doing the count. The latter would require more design work.

    As for having the number of posts right next to the name, I’m not sure how that differs from the way it is now. What do you mean by that one?

  20. Robin says:

    I meant the latter. I just want to have a list of the top 10 commenters for every month. The other thing isn’t a big deal, it just took up extra space but that’s ok.

  21. Darwin says:

    Hi:

    I installed the plugin and it list the top commenters. But it doesn’t make their name a link. The only one that is a link is my name. What am I doing wrong?

  22. JB says:

    The current version only adds links for registered users. I used to add the links provided in the comments, but don’t anymore for several reasons. Here’s a summary of the main one:

    People change URLs and/or provide different ones over time, and then I would need to alter the code and make sure I’m always getting the URL from the most recent comment by anyone of that name. If that were the only problem, then that solution (recoding) would be fine, and I would do it.

    The downside is that if it’s always going off the most recent comment by that name, then all a spammer would need to do is post a comment using that same name to get their link into the list.

    I prefer the registered users method, since it still takes all users into account, but only ads links for people who want them. Then they can go in and alter them anytime as well.

    I’ve also thought about going through and adding new user accounts for people in my top 10 list who I know have URLs but haven’t registered; I just haven’t done that yet.

  23. Pingback: BloggingPro China » WordPress Plugin: Top Commenters

  24. lomig says:

    hi,
    this is a great plugin…the only bad thing to me is the same as Darwin, the fact that names of best commenters don’t link to their sites…!
    is it very complicated to program ? because in the comment part, people’s name is a link, so it’s possible to do it without a logged-in user, or account..no ?
    the spam is not really a problem, as askimet is doing a great job !
    thnak again, and i’ll be happy if you make a “names with links” version of your plugin
    great job,
    thank you
    LOmiG

  25. JB says:

    See my previous comment for why I don’t think that’s a good idea.

    It used to actually work that way, however, and it would be fairly easy to change it back.

    If you’d like to do that, all you would need to do is replace $user_data->user_url on lines 116 and 120 with $commenter->comment_author_url and it will use the links provided by the commenters.

    Just be aware that if you do that, there’s no way to prevent anyone at all from commenting using the same name as someone in your top commenters list and bumping out the original person’s link.

  26. Paul says:

    Hmm, I download it, but I’m only getting the .php file. There’s no “freepress” folder or anything. I tried just putting the .php file into my plugins folder, but that didn’t work.

  27. JB says:

    You don’t actually need the subdirectory for this plugin, since it’s only one file. putting it in the plugins folder and then activating it should make it available.

    Once it is activated, you can follow step 2 or 3 (depending on whether or not you are using widgets) to add the listing to your theme.

  28. Vlad says:

    Is it possible to show the number of comments next to the commentors name?

  29. JB says:

    Yep; looks like you figured it out.

  30. George says:

    Awesome plugin. I’m quite curious to see if this will draw some extra comments.

    Regards, George

  31. Cavalcare says:

    That’s a great plugin. It’s a pity it does only work on wp and not on other third-party blog management systems.

  32. JB says:

    Not really.

  33. Navjot Singh says:

    Please check my site http://www.exguides.org Its showing SQL error first and then displays the commenters. And also it is pulling Pingbacks and Trackbacks. I would love to have option to exclude pingbacks and trackbacks from the plugin.

    Please check for bug on http://www.exguides.org

    I am using WordPress 2.1.3.

    Actually I think its due to the ‘ sign in the commenter’s name.

  34. Navjot Singh says:

    Ok I removed your plugin…I am using Otto Execute PHP in Widgets plugin and I added code from another Top Commenters plugin. But you should check your plugin since it fails when Commenter’s name contains apostrophe sign.

  35. Runa says:

    Great plugin. It works well and brings a lot of new visitors.

  36. Pingback: 10 Quick Methods to Increase Blog Comments « Legal Andrew

  37. Pingback: TheAdamBox.com - Success in Life, Relationships, and Making Money. » Blog Archive » DoFollow and Top Commenters

  38. Pingback: DoFollow and Top Commenters | BlogBait.net

  39. Josh says:

    I’m sure this is an absurdly noob question, but how do I edit the color of the commenters’ names? The plugin is working great, but the default color looks horrible with my theme :)

  40. JB says:

    No worries; each name is a list item with a class of “topCommentersListItem”, so you can add something like the following to your CSS file:

    li.topCommentersListItem { color: #123456; }

    If your commenters are registered users with URLs, those list items will contain links, so you may need:

    li.topCommentersListItem a { color: #123456; }

    depending on your existing style definitions for links.

    Hope that helps!

  41. Pingback: 1000+ Comments Milestone! Thank You! » article » fruityoaty.com

  42. Josh says:

    I added both lines to my CSS file, but I still cannot seem to get the color to change…

  43. JB says:

    Hmm, are you talking about the site you linked to in your comment ?

    I don’t see any lines in the CSS on that page that relate to the top commenters plugin, but I do see the following:

    #sidebar UL UL LI { COLOR: #777 }

    which is what is currently dictating the color of those list items in your page.

  44. Josh says:

    I had added li.topCommentersListItem { color: #123456; } to the bottom of my CSS line, but since it did not work, I removed it. I have since added it again, directly under the spot you mentioned, but I still cannot seem to make it work. I’ll leave it up there so you can look at it and see what I’m doing wrong. Thanks for all the help so far :)

  45. JB says:

    Josh, no problem -

    Since the other rules are id based (with a #), you will need to override the color set in the line above this with the !important attribute, like so:

    li.topCommentersListItem { color: #800000 !important; }

    That ought to do the trick.

  46. Josh says:

    Ah, that did it. Thank you so much, both for the great help and the great plugin.

  47. Shawn says:

    Thank you thank you THANK you for a cool plugin that does this, and just WORKS. I tried two other plugins before finding yours and neither one did it RIGHT. You rule.

  48. JB,

    First of all, thanks for the great plugins. I’m using the recent comments plugin and just added the top commenters plugin. I’ve also added you to my Supported Plugins list on my free Rapid Access theme page.

    I do have one small issue with the top commenters plugin that I’m thinking you can probably whip up a fix for very quickly. If you look at my blog you’ll notice that my top commenters have not entered a URL in their profile and it is creating a link to “http:///”.

    Could you modify the plugin to check for that and not create a hyperlink in that case?

    Thanks,

    John

  49. JB says:

    Yeah, shouldn’t be too hard. I’m sick right now, so I might not get to it right away, though.

  50. JB,

    I’m sorry to hear you’re under the weather. :-(

    Incidently, I gave a little more thought to this plugin and I’m worried that it is possible to have a few folks begin to dominate the Top Commenters box and after a period of time no one would be able to displace them.

    For this reason I would like to second the previous suggestion about only displaying the last month’s worth of comments. But actually, what I’d like to suggest is to have it display the top commenters for the last X number of days, where X is a user selectable variable in the plugin.

    Get well soon!

    John

  51. JB says:

    Good idea.

  52. Pingback: WP Plugins DB » Blog Archive » Top Commenters Plugin / Widget

  53. JB,

    I’ve got an unusual issue. My own comments are showing up as the top commenter despite the fact that I’ve put my nickname in the exclude list on my blog. I am wondering if the fact that my nick has a period in it matters? Though I did put it in there both with and without the period. I also changed the name I was using for posting at one point so I have my old one in there and it is indeed excluding that one. Just not my current one.

    Also, out of curiosity do you think you’re going to have time to incorporate the “last X number of days” into the plugin any time soon? If not, do you have any hints as to where that change my be best and I’ll take a look at it?

    Thanks,

    John

  54. JB says:

    Hopefully I’ll take a look at that new feature soon.

    I can’t think of why the exclusion thing may not be working; I’ll take a look at that as well. I’m assuming you’re talking about the “John P.” one?

  55. Sorry about the slow reply. Yes, the one I’m referring to is the “John P.” user. I used to go by “The Man” and luckily that one is not showing up… :-)

    John

  56. skyati says:

    hye JB.. nice plugin.. good job~ :D
    i want to ask, if i just installed the plugin, will it count from the second i installed it, or it will count the previous comments?
    because i cannot see any commenter list at my site now.. thanx..

  57. JB says:

    Should count all previous comments.

  58. Pingback: My Blog It: Blogging for nothing

  59. ck says:

    I’d love to use this plugin, but after downloading I am unalbe to extract the files…have tried multiple ways.

  60. JB says:

    Should just be a regular gzipped tar file; tar -xzf topCommentersWidget.php.tar.gz

    Maybe I need to post zip versions for people who can’t get the gz versions for whatever reason.

  61. Vic says:

    This plugin is a must peeps love to see themselves on the list.

    Thanks

    Vic

  62. SEO Blogger says:

    hi, I’m just wondering if there’s a way to ‘Reset’ the count after let say 1 week, 1 month, etc. (just like the Show Top Commentators plugin(?

  63. Paul Oyler says:

    I take care of my Pastor’s blog for him and I’ve been using this plugin for quite some time now and everyone really seems to love it. In fact, 10 or 15 of his ‘regulars’ tend to have fun trying to gain the “top of the list”.

    The problem is that prior to this being installed, there were 4 regular commenter’s who used a different, silly name every time they left a comment.

    Is there a way that I can adjust totals in the MySQL database to bring their totals up to what they should be? And if so, what exactly would I modify?

    Thanks again for a great plugin!

    Grace and Peace,
    Paul

  64. JB says:

    Paul,

    The only way I can think of would be a SQL query that would update the comment author name on all the comments you know are theirs to a common name that you select (whichever one they use now).

    I’ve done that before on here, actually, shortly after I made the plugin, for the same reason you describe.

    I can check and post the exact SQL if you’d like.

  65. Paul Oyler says:

    That would be great JB. I learned the hard way that I’m not very good doing my own SQL queries, it can get quite messy when something is in the wrong order…

  66. JB says:

    Sorry for the long delay in replying; I’m just pulling into town from a long vacation. I’ll post some sample SQL tomorrow.

  67. Scott CLark says:

    I keep getting an empty value for $user_data->user_url even when commenters have inserted URLs for their comments. The rest of my blog works great. Latest WP version.

    ???

  68. BAM says:

    I would like to manually add this widget to my sidebar.php. For some reason in my browser it is not showing the code you typed in. Can you please send me the code so that I can add it to my sidebar.php? Thanks and I look forward to using this widget!

  69. Kate says:

    I have added the widget and it is displaying in my sidebar, but the name of each commenter is just plain text, there is no link to their site – I used the Top Commenters plugin with my previous theme were it was pasted into the sidebar directly and the names were linked then. Any help appreciated.

  70. JB says:

    There was a recent change to only grab commenter URLs from registered users (from their profile) rather than the one(s) supplied in the comments themselves.

    I like it better that way for several reasons, but I think in the next version I’ll make it an option for the admin to set.

  71. anthraxxxx says:

    What is the code to make it show up in our site if we are doing it manually?

  72. hurry says:

    Yes, I need the manual insertion code too. I can’t see it in your above post. Please.

  73. JB says:

    In lines 116 and 120 of the current version of the plugin file (4.1), change $user_data->user_url to $commenter->comment_author_url

  74. Mihai says:

    Very cool plugin..I like it

  75. Pingback: links for 2007-11-19 — Michel Vuijlsteke's Weblog

  76. Pingback: links for 2007-11-19 — Michel Vuijlsteke's Weblog

  77. Missy says:

    Does this plug-in come in a ZIP file? I’m having trouble downloading it as tar.

  78. Caitlin says:

    Great plugin!
    I like the new change of only grabbing the URLs of registered users, but I agree that making this an admin option would be nice.
    Thanks for creating this! ^_^

  79. Pingback: Wordpress Comments Part One: 50+ Plugins | Final Stop

  80. Pingback: 8 Ways To Get More Comment from Your Visitor | Thewirds

  81. Pingback: 30 WordPress Plugins to Spice Up Your Blog - Maverick Web Creations

  82. Pingback: Cool Change

  83. Free Weblog says:

    Thanks for this plugin, this is exactly what I was looking for!

  84. Jessie Stone says:

    Thanks for the review guys, now i know about plugin. but i cant see the code in the upper side of your post JB please post it again..

    Thanks

  85. Most bloggers comment was not apprieciated on most blog but with this great system. I am sure more people would like to leave their comment. cheers

  86. Good Thank you admin

  87. Pingback: 5 Ways You Can Improve Your Blog

  88. Juana says:

    Hola

    El partido del domingo entre el Barça y el Madrid será el acontecimiento del año sin duda alguna y yo no me lo pienso perder de ninguna manera, aqui en esta pagina lo daran Online y Gratis !

    http://elgranderbi.blogspot.com/

    Saludos,
    Juana.

  89. Awesome, thanks for the plugin! It really works to increase the number of quality comments on your site.

  90. Ex says:

    Great Plugin

  91. Acai Optimum says:

    I cant get the plugin download to open.

  92. Detroit Tube says:

    What is it exactly that we should think here? I mean is that really going to matter?

Comments are closed.