Contensio logo

Reading Time

Estimated reading time in the post meta row for Contensio.

About this plugin

Reading Time

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.


Requirements

  • Contensio 2.0 or later

Installation

Composer

composer require contensio/plugin-reading-time

Manual

Copy the plugin directory into your Contensio installation and register the service provider via the admin plugin manager.

No migrations required.


How it works

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>&middot;</span><span>' . e($label) . '</span>';
});

Calculation

ReadingTime::minutes() builds a plain-text corpus from:

  1. The post title
  2. The excerpt
  3. 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.


Using ReadingTime in your theme or plugin

use Contensio\Plugins\ReadingTime\Support\ReadingTime;

$minutes = ReadingTime::minutes($content, $translation);  // int, minimum 1

Changing the WPM rate

The 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 reference

Hook Type Args Description
contensio/frontend/post-meta Render Content, ContentTranslation Inside the post meta row, after the publish date