Geek Rant dot org

 

Fri 2006-04-21

WordPress Most comments

Filed under: — daniel @ 07:05

Here’s the SQL to find which of your Wordpress posts have the most comments:

SELECT wp_comments.comment_post_id, count(*) as commentcount, wp_posts.post_title, wp_posts.post_date FROM wp_comments, wp_posts
where wp_comments.comment_post_id = wp_posts.ID
group by wp_comments.comment_post_id, wp_posts.post_title, wp_posts.post_date
order by commentcount desc

Digg this

2 Responses to “WordPress Most comments”

  1. Glen McGregor Says:

    So which post has the most comments? It’d be interesting to know. Unless of course there’s lively discussion here and this post ends up with the most!

  2. daniel Says:

    Fair question! (One I originally answered for my personal blog).

    The top five are:

    A Windows user’s adventures in Linux (42 comments)

    Commonwealth Games patch (21)

    Spam Karma (18)

    Why I both love and hate my iPod (18)

    The Most Basic Guide Available To Downloading Television Shows With Bit Torrent (15)

Leave a Reply


26 queries. 0.452 seconds. Powered by WordPress