How to fix Customized Recent Comments duplicate comments

Customized Recent Comments is a great plugin for displaying recent comments on your WordPress blog. It has all the features I need and requires minimal install and setup.

With most ‘recent comments’ plugins/widgets, if you (the blog owner) respond to a bunch of comments at once, you end up having your comments take up the entire recent comments listing 🙁 Thankfully, one of my favorite features of the plugin is its ability to exclude particular commenters from being listed. 🙂

However, the only issue I have found with the plugin is that there is a bug in the SQL that can cause comments to be listed multiple times if you enable the category specific filtering feature. Thankfully, a helpful WordPress.org forum member posted a simple fix. All it requires is that  add DISTINCT to the SQL query found at line 505 of the plugin:

Before:

$query = "SELECT c.comment_ID, c.comment_post_ID, c.comment_author, c.comment_author_email, [...]

After:

$query = "SELECT DISTINCT c.comment_ID, c.comment_post_ID, c.comment_author, c.comment_author_email, [...]

A big THANK YOU and 5/5 stars to ‘tophost’ for posting the awesome solution! 🙂

More info:

WordPress › Support » [Plugin: Customized Recent Comments] Double commentshttp://wordpress.org/support/topic/plugin-customized-recent-comments-double-commentsBUG. When you use the option to exclude a category, all the comments of an article that is part of multiple categories are duplicated. To solve this problem just open the file…
WordPress › Support » [Plugin: Customized Recent Comments] Exclude admin or specitif usershttp://wordpress.org/support/topic/plugin-customized-recent-comments-exclude-admin-or-specitif-usersAlso is their any way to get the plugin to incorporate KeywordLuv? I ask as many of my commenters use it by typing in their name, followed by @ and then their keywords. This…

 

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *