Title: Displaying Random Comments
Last modified: August 20, 2016

---

# Displaying Random Comments

 *  [mikeweeks](https://wordpress.org/support/users/mikeweeks/)
 * (@mikeweeks)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/displaying-random-comments/)
 * I wanted to display a random comment from the database. Really quite simple, 
   just find `date_time` DESC in the main file and change for RAND()
 * Mike
 * [http://wordpress.org/extend/plugins/wp-customer-reviews/](http://wordpress.org/extend/plugins/wp-customer-reviews/)

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

 *  [essaysnark](https://wordpress.org/support/users/essaysnark/)
 * (@essaysnark)
 * [13 years ago](https://wordpress.org/support/topic/displaying-random-comments/#post-3374881)
 * [@mikeweeks](https://wordpress.org/support/users/mikeweeks/) I know your question
   is really old but we hacked a solution to this. In wp-customer-reviews.php, on
   line 420, replace part of the FROM line like so:
 *     ```
       ORDER BY date_time DESC $limit
       ```
   
 * to
 *     ```
       ORDER BY RAND(UNIX_TIMESTAMP(NOW())) $limit
       ```
   
 * There’s backticks in the original bit around date_time. Ditch those, none needed
   in the replacement (keep the first part of the line with FROM obviously – I couldn’t
   copy in the whole thing here due to the backticks).
 *  [essaysnark](https://wordpress.org/support/users/essaysnark/)
 * (@essaysnark)
 * [13 years ago](https://wordpress.org/support/topic/displaying-random-comments/#post-3374882)
 * Doh. Just realized that you were posting a SOLUTION not a question. Wish I’d 
   found yours earlier!!

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

The topic ‘Displaying Random Comments’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-customer-reviews_47737d.svg)
 * [WP Customer Reviews](https://wordpress.org/plugins/wp-customer-reviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-customer-reviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-customer-reviews/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-customer-reviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-customer-reviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-customer-reviews/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [essaysnark](https://wordpress.org/support/users/essaysnark/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/displaying-random-comments/#post-3374882)
 * Status: not resolved