Title: Random related posts
Last modified: August 21, 2016

---

# Random related posts

 *  Resolved [nvhcuong](https://wordpress.org/support/users/nvhcuong/)
 * (@nvhcuong)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/random-related-posts/)
 * I want to random related post each time viewer go to single post. How can I do
   that?
 * [https://wordpress.org/plugins/wordpress-23-related-posts-plugin/](https://wordpress.org/plugins/wordpress-23-related-posts-plugin/)

Viewing 1 replies (of 1 total)

 *  [PetraP](https://wordpress.org/support/users/petrap/)
 * (@petrap)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/random-related-posts/#post-4950027)
 * Hey nvhcuong,
 * thanks for reaching out!
    The thing is – when you write a post, the plugin generates
   the cache of its own to avoid making any unnecessary information retrieval requests.
   You can change this but it could cause a **major performance issue**. So, before
   I give you the code to change this, I would like to suggest you these two plugins
   to try out: 1.) [Advanced Random Posts](https://wordpress.org/plugins/advanced-random-posts-widget/)
   2.) [Spider Random Posts](https://wordpress.org/plugins/spider-random-post/)
 * Or use this – the following code will cause related posts to be regenerated every
   time a reader will visit your blog. If you expect a lot of readers, we strongly
   advise you against this change!
 * In file _recommendations.php_ comment out parts of two rows and set value of 
   both variables to false:
 *     ```
       $related_posts_query_result_cache_expiration = false; //(int) get_post_meta($post->ID, '_wp_rp_related_posts_query_result_cache_expiration', true);
       $related_posts_query_result_cache = false; //get_post_meta($post->ID, '_wp_rp_related_posts_query_result_cache_'.$options['max_related_posts'], true);
       ```
   
 * Please be aware that this is **a very risky action** that might significantly
   affect the performance of your site and the server and that we cannot take any
   responsibility for this changes.
 * In any case, hope it goes well. And do let us know, we’re eager to hear about
   the results (if you choose to execute it).
 * Take care & have a nice day!
 * Best,
    Petra

Viewing 1 replies (of 1 total)

The topic ‘Random related posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-23-related-posts-plugin_7b9a7c.
   svg)
 * [WordPress Related Posts](https://wordpress.org/plugins/wordpress-23-related-posts-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-23-related-posts-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [PetraP](https://wordpress.org/support/users/petrap/)
 * Last activity: [11 years, 12 months ago](https://wordpress.org/support/topic/random-related-posts/#post-4950027)
 * Status: resolved