Adding Estimated Read Time to a WordPress Post

Ever since Medium popularized the concept of the read times on articles, I’ve been seeing it as a design element in more WordPress projects.

Getting a great estimate for average read time is complicated, but if you just need a blunt tool for calculating it, you can use:

amount of words in the post / average reading speed

According to Medium, people read about 275 words per minute. Medium also adds 12 seconds for each inline image, but I didn’t get that fancy.

Here’s the snippet:

https://gist.github.com/devinsays/cd6b089dd2f138bcf668d5f938e38dbf#file-estimate-read-time-php

To output the read time in your post, use something like this:

https://gist.github.com/devinsays/cd6b089dd2f138bcf668d5f938e38dbf#file-output-php

If you prefer to use a plugin, there’s a few around. This snippet is mostly borrowed code from Reading Time WP, which is also on GitHub.

About Devin

I am a developer based in Austin, Texas. I run a little theme shop called DevPress and help manage a WooCommerce shop with Universal Yums. Find me on twitter @devinsays.

2 Responses

Leave a Reply