Post Recommendations Based on Time Spent WordPress Plugin


We all would love to keep our visitors on our website for longer and reduce our bounce rate. One way to do is by showing posts to people who spend a lot of time reading your content already. Based on my research, there is currently no plugin that offers such functionality. With a little bit of JavaScript and PHP, you can write your own code.

The PHP function queries your posts for related posts based on shared categories or tags. You are going to need a JavaScript function that sends an AJAX request to get related posts after a certain period of time.

For your recommended posts, you will need to add a DIV with “time-based-recommendations-placeholder” id. Yet another simple way to reduce bounce rate on your site. How would you improve this code?

More WordPress reading: