What it does
Read Time Machine counts the words in a post, divides them by a reading speed (200 words per minute unless you change it) and rounds up to whole minutes, with a minimum of 1. It then adds a short label such as 3 min read just before or just after the post content.
It works as soon as you activate it: with the default settings, single posts and pages show the label before their content, in the Minimal style. From its settings page you can change the reading speed and the wording, add the word count, pick one of nine style presets or design your own, animate the numbers, choose the post types, and exclude posts by ID, category or tag. A checkbox in the post editor switches it off for one post.
The count is stored with the post when you save it. The plugin makes no external requests, and deleting it removes its settings and stored counts.
- Posts · Pages · custom post types
- Before or after content
- 9 style presets
- Shortcode
- No external requests
Install
- Download the ZIP.
- In WordPress go to Plugins → Add Plugin (called Add New Plugin or Add New in older versions), click Upload Plugin, choose the ZIP, click Install Now, then Activate Plugin.
- View any single post or page: with the default settings the label appears before the content. Nothing has to be configured first.
- To change the settings, click Settings under the plugin's name on the Plugins screen, or open Read Time Machine at the bottom of the admin menu.
How to use
The plugin has its own menu item, Read Time Machine, with a clock icon at the bottom of the admin menu (admin.php?page=read-time-machine).
It is not under Settings, and only administrators (users with the manage_options capability) can open it. The page has two tabs:
- Settings: reading speed, position, label text, word count, style preset, mobile options, animation, post types and exclusions.
- Styles: an optional Style Builder with colour, padding, font and border controls, a live preview and a read-only box that shows the CSS for the current controls.
Step by step
- Open Read Time Machine. The Settings tab opens first.
- Set Words Per Minute and Display Position (before or after the content).
- Edit the Label Template, for example
Reading time: {minutes} min. Tick Show Word Count to get a label like “3 min read • 512 words”. - Choose a Style Preset, the Enabled Post Types (Posts and Pages are on by default) and any exclusions, then click Save Changes.
- For your own colours and spacing, open the Styles tab, tick Enable Style Builder, adjust the controls while you watch the live preview, and click Save Changes on that tab. Each tab saves only its own fields, so save before you switch tabs.
Switch it off for one post
In the post editor, the sidebar has a Read Time Machine box with the checkbox Disable reading time for this content. Tick it and update the post: the automatic label and the shortcode both stay hidden for that post. The box is only an on/off switch; you can't type a reading time by hand.
The shortcode
[read_time_machine] prints the same label for the current post where you place it. It takes no attributes. The plugin has no block or widget,
so in the block editor put the shortcode in a Shortcode block.
The automatic label is still added on single views of enabled post types, so a shortcode inside such a post gives you two labels.
The settings have no switch for the automatic label; a developer can remove it with the rtm_output_html filter (see For developers).
Outside single views of enabled post types the plugin's stylesheet is not loaded, so the shortcode's label appears there without the preset styling.
Settings
Until you save a tab, the plugin uses the defaults below. Excluded posts and posts switched off in the editor show neither the automatic label nor the shortcode.
Settings tabdefault · allowed · effect
- Words Per Minute
- 200. Whole numbers from 50 to 1,000. An empty box saves 50, not the default. Reading time is the word count divided by this number, rounded up, with a minimum of 1 minute. Stored counts belong to the speed they were made with, so after a change posts are counted again.
- Display Position
- Before Content. The other choice is After Content.
- Label Template
{minutes} min read. Plain text: HTML tags are removed when you save, and an empty box brings back the default.{minutes}and{words}are replaced with the numbers.- Show Word Count
- Off. When on, “ • 512 words” (with the post's own count) is added after the label.
- Style Preset
- Minimal. Built-in: Minimal, Badge, Pill and Inline. Extra presets: Marker, Underline, Outline, Left Bar and Gradient. Not used while the Style Builder is enabled.
- Mobile Display
- Hide on mobile and Compact style on mobile, both off. Both work at 600 px and narrower, through the classes
rtm-hide-mobileandrtm-compact-mobileon the label. Hide on mobile hides the label there. Compact style on mobile sets its text to 12 px and gives the Minimal, Badge, Pill, Underline and Left Bar presets less padding; with the Style Builder on, it sets the builder's text to 12 px and its padding to 2 px top and bottom and 6 px at the sides. Separately, at 600 px and narrower the Badge, Pill and Minimal presets always get slightly less padding. - Animated Numbers
- Off. When on, the numbers count up from 0. Duration 900 ms and delay 0 ms (each 0 to 20,000 ms). Start animation when the label becomes visible is on by default: the count starts when 30% of the label is on screen. When it is off, the count starts as the page loads.
- Entrance Animation
- Off; duration 350 ms and delay 0 ms (each 0 to 20,000 ms). “Fade/slide in the label” fades the label in while it slides up slightly (the Inline preset only fades),
over the set duration and after the set delay. A label that is on screen when the page loads animates straight away. One further down the page waits until it scrolls into view,
unless Start animation when the label becomes visible is off; then it animates as the page loads.
Without JavaScript the label still fades in as the page loads, and visitors who have turned on reduced motion in their system settings see it at once, without the effect.
The label carries
data-rtm-entrance="1"and the CSS variables--rtm-entrance-durand--rtm-entrance-delay; the script adds the classrtm-waitto a label that waits off screen, andrtm-inonce the label is in view (or as the page loads, if that option is off). Turning it on also loads the animation script. - Enabled Post Types
- Posts and Pages. Any public post type except Media, custom post types included. Decides where the label, the editor box, the shortcode and the stylesheet work. If you untick every box, the setting goes back to Posts and Pages.
- Exclude Post IDs
- Empty. Post IDs such as
12, 45, 78; any character that is not a digit separates them. - Exclude Categories
- None. Tick categories to skip the posts filed directly in them. Child categories are not included automatically.
- Exclude Tags
- Empty. Comma-separated tag slugs or IDs, such as
news, updates, 23. An entry made only of digits is read as a tag ID; any other entry is converted to slug form first.
Styles tabdefault · allowed · effect
- Enable Style Builder
- Off. When on, the label text is wrapped in a
spanwith the target class, the Settings-tab preset is no longer applied, and CSS built from the controls below is added inline on the pages that load the plugin's stylesheet. - Target CSS class
rtm-reading-time. Letters, digits, hyphens and underscores; other characters are removed. If you clear it, the builder has no effect and the Settings-tab preset is used again.- Style Preset
- Pill. The same nine presets, used here to pick the recipe for the builder's CSS.
- Colors
- Color 1
#FFF1BD, Color 2#FFCA08, Text#111111. Hex colours only; an invalid value saves the default. Color 1 is the background, border, underline or bar colour, depending on the preset. Color 2 is the Badge background, the Minimal accent and number colour, and the end of the Gradient. - Padding
- Horizontal 10 px (0 to 80), vertical 4 px (0 to 40). Each control is a slider with a number box; a number outside the range is corrected when you leave the box.
- Typography
- Font size 14 px (10 to 28), font weight 600 (100 to 900, in steps of 50).
- Radius
- 10 px (0 to 60). Used by Minimal, Badge, Pill, Outline and Gradient.
- Border width
- 2 px (0 to 10). The Minimal accent and the Outline border.
- Underline thickness
- 4 px (1 to 20). The Inline and Underline presets.
- Bar thickness
- 6 px (1 to 20). The Left Bar preset.
- Display
- inline. The other choice is inline-block. Minimal always uses inline-flex.
How it works
- Where the label goes. It is added through the WordPress
the_contentfilter, late (priority 999), and only on single views of enabled post types. Only the page's main post gets it, once per page load. The blog index, archives, search results and feeds show none. - What counts as a word. The post is rendered first: blocks, shortcodes and, when Elementor is active and the post has Elementor data, Elementor's output. The HTML is then removed, scripts and styles included, and runs of letters and digits in any alphabet are counted. A word with an apostrophe or a hyphen inside, such as don't or well-known, counts once. Images and video add no time.
- The maths. Minutes = words ÷ words per minute, rounded up, never less than 1. Seconds are not shown. When no words are found, no label is shown.
- Stored counts. When you save a post, its minutes, its word count and the reading speed used are stored in post meta, and page views reuse them while the speed stays the same. A post without a stored count, such as one published before the plugin was activated, is counted on each view until it is saved again or viewed by a user who can edit it. Visitors' views never write to the database.
- Front-end files. The stylesheet (about 6 KB) loads only on single views of enabled post types. The animation script (under 3 KB, no jQuery) loads in the footer, and only when number or entrance animation is on. Style Builder CSS is added inline, not as an extra file.
- Animation. Each number counts up from 0 to its value at an even pace over the set duration, after the set delay.
- Dark mode. The label's colours do not change with the visitor's system colour scheme. Minimal, Inline, Marker, Underline, Outline and Left Bar use your theme's text colour, so they follow a light or a dark theme. The Minimal number mixes the accent colour with that text colour, and the Marker highlight is see-through, so it stays light on a light theme and dark on a dark one. Pill keeps dark text on its yellow, Badge has white text on the accent colour, dark blue by default, and Gradient has white text on a gradient from that colour to a dark mix of the two accent colours. With the Style Builder on, its own colours apply.
How it stays safe
- Admins only. The settings page needs the
manage_optionscapability, and both tabs save through the WordPress Settings API (options.php), which checks that capability and a nonce. - Checked post saves. The editor checkbox is saved only with a valid nonce, never on autosaves or revisions, and only by users who can edit that post.
- Clean input. Numbers are whole numbers kept inside their ranges, choices are checked against fixed lists, text is sanitised, post types must be public, colours must be hex values and the class name may contain only safe characters.
- Escaped output. Values and attributes are escaped, and the label passes through
wp_kses, which removes every tag exceptspanand every attribute exceptclassanddata-rtm-number. - Safe custom CSS. The Style Builder writes CSS only from sanitised values: hex colours, whole numbers and fixed choices.
- No writes from visitors. Counts are stored only when a post is saved or viewed by a user who can edit it.
- Nothing leaves your site. No external requests, no tracking, no third-party libraries and no direct SQL queries. Uninstall uses WordPress's own functions.
- No direct access. Every PHP file with code stops unless WordPress loads it.
For developers
Filterarguments · use
- rtm_enabled_post_types
$types. Change the post types that get the label, the editor box and the front-end files. Returning an empty list, or anything that is not an array, stops the label everywhere, but if the Style Builder is on, its CSS and the plugin's stylesheet then load on every front-end page.- rtm_wpm
$wpm, $post_id. Change the reading speed, for example per post. It runs after the 50 to 1,000 limit, so the returned value is not limited to that range.- rtm_word_count
$count, $text, $post_id. Change the word count;$textis the cleaned text that was counted. Negative results become 0.- rtm_read_time_minutes
$minutes, $word_count, $wpm, $post_id. Override the minutes. Results below 1 become 1.- rtm_output_html
$html, $minutes, $word_count, $post_id, $context. Change or remove the final markup.$contextiscontentorshortcode. Whatever you return is printed as it is, so escape your own values.
To keep only the shortcode's label and drop the automatic one:
add_filter( 'rtm_output_html', function ( $html, $minutes, $words, $post_id, $context ) { return 'content' === $context ? '' : $html; }, 10, 5 );
- Markup with the default settings:
<p class="rtm-read-time rtm-style--minimal" data-rtm-minutes="3" data-rtm-words="512" data-rtm-animate="0" …><span class="rtm-num" data-rtm-number="3">3</span> min read</p>. - Most preset colours come from CSS custom properties on
.rtm-read-time:--rtm-accent,--rtm-accent-2,--rtm-text(the Pill text),--rtm-muted(the Minimal and Inline text; your theme's text colour unless you set it),--rtm-softand--rtm-border. Override them in your theme to match your brand. A few colours are fixed, such as the white text of Badge and Gradient and the light start of the Pill gradient. - Front-end handles: the stylesheet
rtm-frontendand the scriptrtm-animate. - The plugin fires no actions of its own. It hooks
plugins_loaded(to start),the_contentandelementor/(both at priority 999),frontend/ the_content save_post(10 and 20),wp_enqueue_scripts(10, and 99 for the Style Builder CSS),add_meta_boxes,admin_init,admin_menu,admin_enqueue_scripts,custom_menu_orderandmenu_order(to move its menu to the bottom), and on the Plugins screenplugin_action_links_andread-time-machine/ read-time-machine.php plugin_row_meta. - Storage: the options
rtm_settingsandrtm_style_options(nothing is stored for a tab until it is saved; the defaults apply until then), and the post meta keys_rtm_disable,_rtm_read_time_minutes,_rtm_word_countand_rtm_wpm_used. No custom tables, transients, cron jobs or files. - Deactivating the plugin keeps everything. Deleting it removes both options and all four meta keys. On multisite, where plugins are deleted from the network admin, only the main site is cleaned; the other sites keep their options and post meta.
Questions
Why does my front page or contact page show a reading time?
Pages are enabled by default, and a static front page is a page too. Untick Page under Enabled Post Types, add those pages to Exclude Post IDs, or tick Disable reading time for this content in each page's editor.
A post doesn't show the label. Why?
Usually one of these: the view is not a single post (the blog index, archives and search results never show it), the post type is not enabled, the post is excluded or switched off,
or no words were found. The label is added through the_content, so a theme or builder that prints the post another way gets none. It is also added only once per page:
if the theme or another plugin runs the_content for the same post earlier, for example to build an excerpt, the label lands there instead.
Does it work with Elementor?
It has Elementor-specific handling: when Elementor is active and a post has Elementor data, the count uses Elementor's rendered content, and the label is also hooked into Elementor's content filter. Check how it behaves on your own Elementor pages before you rely on it.
Does it count Arabic and other languages?
Mostly. It counts runs of letters from any alphabet, so languages that put spaces between words, Arabic included, are counted well. There are two exceptions. Languages written without spaces, such as Chinese and Japanese, are under-counted. Combining marks split words, so Hindi, and Arabic written with diacritics (even a single shadda), are over-counted. Thai, which has both, gives unreliable counts.
Will it slow my site down?
It adds one stylesheet of about 6 KB on single posts and pages, and a script under 3 KB only if you turn on animation. Counting happens when you save a post, and page views reuse the result. Posts that have not been saved since the plugin was activated, or since the reading speed was changed, are counted on each view until they are saved again or viewed by a user who can edit them.