Displays an estimated reading time in the post meta row, alongside the author name and publish date.
Iosif Chimilevschi · Apr 19, 2026 · 5 min read
No database, no admin UI, no configuration.
- Contensio 2.0 or later
composer require contensio/plugin-reading-timeCopy the plugin directory into your Contensio installation and register the service provider via the admin plugin manager.
No migrations required.
The plugin hooks into contensio/frontend/post-meta, a render hook fired inside the post meta row after the publish date:
Hook::add('contensio/frontend/post-meta', function (Content $content, ContentTranslation $translation): string {
$minutes = ReadingTime::minutes($content, $translation);
$label = $minutes === 1 ? '1 min read' : "{$minutes} min read";
return '<span>·</span><span>' . e($label) . '</span>';
});ReadingTime::minutes() builds a plain-text corpus from:
- The post title
- The excerpt
- All block content (recursively flattened from the block structure, HTML stripped)
Word count is divided by 200 WPM (average adult silent reading speed) and rounded up. Minimum value is 1 min read.
use Contensio\Plugins\ReadingTime\Support\ReadingTime;
$minutes = ReadingTime::minutes($content, $translation); // int, minimum 1The WPM constant is defined in ReadingTime::WPM. Override by extending the class:
use Contensio\Plugins\ReadingTime\Support\ReadingTime as Base;
class ReadingTime extends Base
{
public const WPM = 250;
}Then swap out the hook registration in your own service provider.
| Hook | Type | Args | Description |
|---|---|---|---|
contensio/frontend/post-meta |
Render | Content, ContentTranslation |
Inside the post meta row, after the publish date |