Reading Time Block

in
Estimated Reading Time: 1 minute

Part of migrating my custom Bootstrap-based WordPress theme to a block theme involved re-implementing various custom plugins and functionality I had built over time. One of these was a shortcode that displayed the estimated reading time for a post. While I could have simply ported the shortcode into the new theme, I saw an opportunity to improve the implementation by converting it into a custom block, making it more flexible and aligned with the block editor’s workflow.

Plugin Settings

For the plugin settings, I chose to integrate the reading speed adjustment directly into the existing Settings → Reading page. Rather than forcing users to rely on a fixed speed, I wanted to offer flexibility while also making it easy to select from common defaults. To help with this, the settings page includes a field for custom input as well as a list of typical reading speeds based on content type.

How Reading Speed is Calculated

Reading speed is typically measured in words per minute (WPM), with averages varying based on content complexity. Dense or technical material tends to slow readers down, while lighter content allows for a faster pace. By offering adjustable WPM settings, the plugin ensures more accurate estimates based on the type of content being published.

Adding The Block

The Reading Time block can be added as usual in the block editor. The inserted block doesn’t show the time in the editor, it displays placeholder text.

Frontend Display

Estimated Reading Time: 1 minute

The Code

The plugin code and zip file are available on GitHub.

https://github.com/revnoah/wordpress-reading-time-block