Title: Descending comments?
Last modified: August 18, 2016

---

# Descending comments?

 *  [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/descending-comments/)
 * I would like my comments to be in descending order instead of ascending. With
   the newest comments at the top. I believe I checked in my templates-functions.
   php and could not find where to do this and I went into my edit-comments.php 
   page and changed ever “ASC” that I found there to “DESC” and they are still in
   ascending order. Can anyone help me out with this?
    Thanks, Daisyhead

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/descending-comments/#post-34401)
 * Open wp-comments.php,
    find
 * >  $comments = $wpdb->get_results(“SELECT * FROM $tablecomments WHERE comment_post_ID
   > = ‘$id’ AND comment_approved = ‘1’ ORDER BY comment_date”);
 * Replace
 * > $comments = $wpdb->get_results(“SELECT * FROM $tablecomments WHERE comment_post_ID
   > = ‘$id’ AND comment_approved = ‘1’ ORDER BY comment_date DESC” );
 * Hope that helps.
 *  Thread Starter [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/descending-comments/#post-34418)
 * It sure did work. Thanks GamerZ! =)
    -Daisyhead
 *  [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/descending-comments/#post-34455)
 * No Problem Daisy =)
 *  [Tim Griffin](https://wordpress.org/support/users/tgriff/)
 * (@tgriff)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/descending-comments/#post-35124)
 * And where is wp-comments in 1.5?
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/descending-comments/#post-35125)
 * Its er deprecated in the default anyway.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/descending-comments/#post-35126)
 * “And where is wp-comments in 1.5?”
 * Check the `comments_template` function in wp-includes/comment-functions.php. 
   You’ll find two $comments lines where you’ll need to add DESC to the SELECT.
 *  [Tim Griffin](https://wordpress.org/support/users/tgriff/)
 * (@tgriff)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/descending-comments/#post-35127)
 * Cool – thanks for Coffee2code.com for e-mailing the instructions for this.
    1.
   Open wp-includes/comment-functions.php 2. locate the comments_template section
   near the top 3. indentify both strings containing the following:
 * `$wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$
   post->ID' AND comment_approved = '1' ORDER BY comment_date"`
 * 4.Change the last part of both lines to: `comment_date DESC"`
 * Thanks Kafkaesqui and Scott Reilly!
 *  [Stephen Yeargin](https://wordpress.org/support/users/yearginsm/)
 * (@yearginsm)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/descending-comments/#post-35135)
 * Anybody know where the hook would be to redefine those variables rather than 
   hacking the core? I’m sure this works, but I like my one-click updates too.
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/descending-comments/#post-35136)
 * Descending comments was discussed last week I think …
 *  [Stephen Yeargin](https://wordpress.org/support/users/yearginsm/)
 * (@yearginsm)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/descending-comments/#post-35137)
 * I’ve tried about three or four different queries for it, but nothing but this
   topic comes up in the search results. As an aside, I’m not a huge fan of the 
   new search engine. 😛 If you happen to come accross the link to it, mind dropping
   it in here?
 *  [elvix](https://wordpress.org/support/users/elvix/)
 * (@elvix)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/descending-comments/#post-35152)
 * Instead of mucking with program code, which makes upgrading a pain, just edit
   your comments.php script.
 * Under: <?php if ($comments) : ?>
 * Add this:
    <?php $comments = array_reverse($comments,true); ?>
 * This reverses the order of the comments array, achieving the descending order
   without changing the db call.
 * You could have different comments.php templates (one ASC and on DSC, for example)
   and just call the one you want into your single templates as you like.
 *  [Mysmasken](https://wordpress.org/support/users/mysmasken/)
 * (@mysmasken)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/descending-comments/#post-35160)
 * Thanks, this last post was very helpful.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Descending comments?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 9 participants
 * Last reply from: [Mysmasken](https://wordpress.org/support/users/mysmasken/)
 * Last activity: [19 years, 8 months ago](https://wordpress.org/support/topic/descending-comments/#post-35160)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
