WordPress Function to Estimate the Time Required to Read an Article
Tempest Media suggests, based on a post by SimpleView Inc. which cites "studies" without being specific about which ones, that the average person spends 37 seconds reading a post but that publishing reading time decreases the bounce rate, increases time on site, and increases page views.
The average adult non-fiction silent reading speed is 238wpm based on 2019 meta analysis by Marc Brysbaert.
Tempest suggests an average reading speed of 200-250wpm citing IrisReading.com which cites the 2019 meta analysis by Marc Brysbaert as well.
Based on the summary of the meta analysis, in English, a "word" is defined as just that, a word, and not a specific number of characters.
Medium.com uses 265wpm and adds time for images with 12s for the 1st, 11s for the 2nd, 10s for the 3rd, and so on to the 10th image after which it adds 3s.
The Function
Add to the WordPress theme's functions.php
file:
function get_the_read_time() {
// Equation: Number of words in the post / reading speed
// Round up to the next full minute
return ceil(count(explode(' ', get_the_content())) / 238);
}
function the_read_time() {
// Print the estimated time to read
// Assumes it will be a value best represented in minutes rather than hours and minutes
// Knows we have rounded up to the nearest minute and have no seconds
$duration = get_the_read_time();
echo ' read';
}
In the template, within the loop, output the value:
<?php the_read_time(); ?>
Feedback?
Email us at enquiries@kinsa.cc.