WP Widget: Recent Comments by Entry


Recent comments list widget but this one is sorted by entry. Entry which contains the latest comments is top, and so on. Following text is commentator for that entry.


WordPress v2.6 or later


Place file in your /wp-content/plugins/ directory and activate through the administration panel, and then go to the widget panel and drag it to where you would like to have it.


Title: Title text for sidebar
Max Entry: Number of entry you want to display. (1)
Max Comments: Number of commentator name you want to display. (2)
Sort: Commentators sort order.


via WordPress.org


* Wed Dec 24 2008 – v0.0.1
- Initial release
* Sat Dec 27 2008 – v0.0.2
- add sort order switch
* Tue Dec 30 2008 – v0.0.3
- compatibility bug fix
* Jan 07 2009 – v0.0.4
- option panel design change
* Jan 26 2009 – v0.0.5
- fixed: trackbacks and pingbacks were in the list
* Jan 29 2009 – v0.0.6
- compatibility fix
* Jan 29 2009 – v0.0.7
- compatibility fix – error logic added if there are no data
* Jan 29 2009 – v0.0.8
- internal bug fix
* Jul 11 2009 – v0.0.9
- CRLF issue on IE 8 had been fixed
* Jan 02 2010 – v0.1.0
- wrong counting when comments and pingbacks/trackbacks combination

•If you like this

If you like this widget, writing small entry on your blog and trackbacking to this entry makes me really really happy!

20 responses

Hi – the plugin worked fine untill there were a pingback from another posting of mine. Then this error message turned up:

Warning: Invalid argument supplied for foreach() in /usr/home/dan17612/public_html/wp-content/plugins/recent-comments-by-entry/widget_recent_comments_by_entry.php on line 132

Can you figure out what’s wrong?

Best Lars


Hi Raapil,

I am watching your site and let me know little information.
- in which version you are using? you can check it at ‘plugin’ menu at dashboard.
- did you modify or edit or open&save php file?

Those information are very helpful to fix this problem for me.
Also if you do not mind, add normal ‘comments’ widget somewhere I can find, so I can compare which pingback makes this issue.

thank you.

Ah, I found something. Did you install two recent-comments-by-entry.php ? In your source file, there’s two of them at one place (maybe). If so, remove one of them from server by using FTP software.

Also, I did update this widget so plz try new one.


I uninstalled 0.5 and upgraded to vs. 0.6 but the error is still there.

AFTER the problem started I opened php-file, but I haven’t changed anything.

I don’t think I’ve installed two r-c-b-e.php, there’s only one at the server.

The problem started first time I had a pingback, so it seems there’s some trouble with this function. I see you have fixed this:

0.0.5 – bug fix: no more trackbacks/pingbacks on the list

But the pingback is still at top of the list.

Best Lars


Hi Raapil,

I found what makes wrong and uploaded 0.0.7 on repository now (so you can download it in few minutes).

The reasone why it was error is missing article. The article ‘Tøsepopper tjener tykt på Tuben’ received pingback from ‘Kunstnerisk nytænkning’ but if I clicked the source link then I saw ‘Indlægget blev ikke fundet’ (http://raapil.dk/?p=6351), means ‘Message not found’.

I modified my php file (now 0.0.7) and added logic to skip if there are no article. So before you remove this pingback, please try 0.0.7 first. This is good chance to find out ‘missing error’ for me, too.



It works in so far as there’s no error message. But the pingback still shows, and it should not?

Also, the error was there before I deleted the article. I deleted it because I thought it would remove the error message.

But something seems to work :)


It should not display pingbacks at list but the data which you removed had type of comment information, too. This means, if you removed article, the type information also removed. There’s no way to find out what it was. However, the article which received pingback remembers ‘something’ came in. I will try to think about how to fix this problem, but now it is better to remove that pingback from its entry by using your dashboard. (means I can simulate this issue locally)

Thanks again.


Ok, thanks a lot :)


Updated: 0.0.8
Empty Pingback issue had been fixed.


Hi Catkick – I wonder if it is possible to make the commenters names clickable on the list on the frontpage – i.e. convert them to links that leads to the comment itself?

The reason is that if you have a lot of comments, you have to scroll down the list that becomes longer and longer. It would be much easier to just click and get to the comment.

A suggestion if you consider upgrading the plugin.

Best Lars


That’s sounds reasonable, maybe i will add checkbox to on/off those links (if without checkbox, it will be complicated when using smaller font). OK, anyway, i put your idea on the list. Thank you!


こんにちは.先日 widget_blogpeople_002の件で
お訪ねしたものです. あれ以来,リーダーに登録して
Recent Comments by Entry の中で調整する方法は







#widget_recent_comments_by_entry {
line-height: 1.0em;











I do consider all the ideas you’ve presented on your post. They’re really convincing and can certainly work. Still, the posts are very brief for novices. May just you please extend them a little from next time? Thanks for the post. ffbadcggdcde

add your comment

*First time to comment? Please comment in English or Japanese to avoid your comment as spam.