Skip to content
Back to blog

How to Display Estimated Post Reading Time in Your WordPress Posts

When visitors land on a blog article, one of the first questions they subconsciously ask is: “How long will this take to read?” Showing an estimated...

Grafiduo
Grafiduo
Jul 20, 2026
11 min read
How to Display Estimated Post Reading Time in Your WordPress Posts

When visitors land on a blog article, one of the first questions they subconsciously ask is: “How long will this take to read?” Showing an estimated reading time directly answers that question, improves user experience, and can even increase engagement and time on site. In this guide, you’ll learn several practical methods to show reading time in your posts, from simple plugins to custom code tailored for developers.

Why Showing Estimated Reading Time Matters

Adding reading time to your content is a small UX improvement that can have a big impact on how readers interact with your site. It’s become a standard pattern across blogs, news sites, and content-heavy platforms.

User Experience and Engagement

When readers see how long an article will take, they can decide whether to consume it immediately or save it for later. This transparency can reduce bounce rates, set realistic expectations, and make your content feel more approachable.

  • Reduces friction: Visitors don’t feel “tricked” into reading a long article.
  • Improves scannability: Alongside headings and summaries, reading time acts as another content cue.
  • Encourages completion: Short reading times in particular can motivate more people to start reading.

SEO and Behavioral Signals

While search engines don’t directly measure reading time, they do consider user behavior signals like dwell time, pogo-sticking, and overall engagement. By helping readers commit to your articles upfront, estimated reading time can indirectly support your search performance.

  • Higher dwell time: Readers who know what to expect are more likely to stay and finish the post.
  • Better content perception: Adding small UX details signals quality and professionalism.
  • More shares and saves: Content that feels manageable gets shared more often on social platforms and via email.

How Reading Time Is Calculated

Before implementing anything in WordPress, you need a consistent way to calculate reading time. Most implementations use an estimated average reading speed and a word count for the post.

Typical Reading Speed

The most common convention is:

  • Average reading speed: 200–250 words per minute (wpm)

You can use any value in this range, but be consistent across your site so your estimates remain predictable.

Basic Reading Time Formula

A simple formula in plain language would be:

Reading time (minutes) = Total words ÷ Words per minute

Then round that number to the nearest whole minute. Most implementations also ensure a minimum of “1 minute” so very short pieces don’t show “0 minutes.”

Should Images Affect Reading Time?

Some solutions factor in images as well, assuming that a user will spend a few seconds looking at each one. A common approach is:

  • First image: 12 seconds
  • Second image: 11 seconds
  • Third image: 10 seconds
  • …then 3–5 seconds per image for the rest

This is optional. If your content is mostly text-based, you can safely ignore images and base your estimate on text alone. If you run a photography-heavy or design-focused site, it may be worth including them.

Method 1: Use a Dedicated Plugin

The easiest way to show reading time on posts is by using a plugin. This is ideal if you want a quick, no-code solution or if you manage multiple sites and need a repeatable workflow.

Choosing a Reading Time Plugin

When selecting a plugin, look for the following features:

  • Automatic placement: Ability to insert reading time before the title, after the title, or before the content.
  • Template tag or shortcode: Flexibility to manually place the reading time in theme templates or blocks.
  • Customizable text: Options to modify labels like “Reading time” or “Read in X minutes.”
  • Translation-ready: Works with localization if you run a multilingual site.
  • Lightweight codebase: Minimal performance impact and no unnecessary bloat.

Configuring a Plugin

While exact settings depend on the plugin, the general setup process looks like this:

  • Install and activate your chosen plugin from the WordPress plugin repository.
  • Go to the plugin’s settings area in the admin dashboard.
  • Select your desired average reading speed (e.g., 200 wpm).
  • Choose where the reading time should appear (e.g., before post content).
  • Customize the label and format (e.g., “Estimated reading time: 4 minutes”).
  • Save the settings and check a single post on the front-end.

If you’re using a block-based theme or the Site Editor, check whether the plugin provides a block that you can insert in your templates. This is often the most flexible way to integrate reading time into modern WordPress layouts.

Method 2: Add Reading Time with Custom PHP Code

For developers and power users, manually adding estimated reading time gives complete control over the output, performance, and styling. This approach doesn’t rely on additional plugins and keeps your setup lean.

Where to Add the Code

You have a few options for adding custom PHP safely:

  • Child theme’s functions.php: Recommended if you manage your own theme and use a classic or block theme with custom templates.
  • Custom functionality plugin: Ideal if you want theme-independent logic that survives theme changes.
  • Code snippets manager plugin: A good choice if you prefer a UI and easy on/off toggling of custom code.

Core Function to Calculate Reading Time

The first step is to create a function that calculates the estimated reading time based on a post’s content:

<?php
function myprefix_get_reading_time( $post_id = null, $words_per_minute = 200 ) {
    $post = get_post( $post_id );

    if ( ! $post ) {
        return 0;
    }

    // Get post content and strip HTML tags
    $content = strip_shortcodes( $post->post_content );
    $content = wp_strip_all_tags( $content );

    if ( ! $content ) {
        return 0;
    }

    // Count words
    $word_count = str_word_count( $content );

    if ( 0 === $word_count ) {
        return 0;
    }

    // Calculate reading time in minutes
    $minutes = ceil( $word_count / max( 1, absint( $words_per_minute ) ) );

    return (int) $minutes;
}
?>

This function:

  • Fetches the post content.
  • Removes shortcodes and HTML tags.
  • Counts the words.
  • Divides by a configurable reading speed.
  • Returns the reading time in whole minutes.

Helper Function to Display the Reading Time

Next, add a wrapper function for displaying formatted output in your theme:

<?php
function myprefix_the_reading_time( $post_id = null ) {
    $minutes = myprefix_get_reading_time( $post_id );

    if ( $minutes <= 0 ) {
        return;
    }

    // Customize this label for your site and language
    $label = ( 1 === $minutes ) ? __( '1 minute read', 'textdomain' ) : sprintf(
        /* translators: %d: number of minutes */
        __( '%d minute read', 'textdomain' ),
        $minutes
    );

    echo esc_html( $label );
}
?>

This function:

  • Retrieves the reading time for the current post.
  • Builds a human-readable label.
  • Echoes a safe, translated string suitable for templates.

Hooking Reading Time into Post Meta

To automatically display reading time for every post, you can hook into common theme locations such as before or after the post title or meta information. This varies by theme, but a generic approach uses the_content filter.

The example below prepends the reading time to the content of single posts:

<?php
function myprefix_prepend_reading_time_to_content( $content ) {
    if ( ! is_singular( 'post' ) || ! in_the_loop() || ! is_main_query() ) {
        return $content;
    }

    $minutes = myprefix_get_reading_time();

    if ( $minutes <= 0 ) {
        return $content;
    }

    $label = ( 1 === $minutes ) ? __( '1 minute read', 'textdomain' ) : sprintf(
        /* translators: %d: number of minutes */
        __( '%d minute read', 'textdomain' ),
        $minutes
    );

    $html  = '<p><strong>' . esc_html( $label ) . '</strong></p>';
    $html .= $content;

    return $html;
}
add_filter( 'the_content', 'myprefix_prepend_reading_time_to_content' );
?>

Once this is in place, all single posts will show a line like “5 minute read” right above the content body, without editing any templates.

Placing Reading Time Manually in Templates

If you prefer full control over placement, call your display function directly in template files such as single.php, content-single.php, or block-based template parts:

<?php
// Example: inside the post header area
if ( is_singular( 'post' ) ) : ?>
    <p class="post-reading-time">
        <?php myprefix_the_reading_time(); ?>
    </p>
<?php endif; ?>

This approach lets you align reading time with your existing post meta (date, author, categories) exactly how you want.

Method 3: Show Reading Time with JavaScript

Sometimes you might not want to touch PHP or theme files. In those cases, a small JavaScript snippet can calculate and inject reading time directly into the front-end. This approach is also useful for headless setups and custom front-ends backed by the REST API.

Basic JavaScript Approach

The idea is straightforward:

  • Select the main content container.
  • Get its text, count the words, and compute reading time.
  • Create an element for displaying the estimate.
  • Insert it near the title or at the top of the content.

Here’s a simple vanilla JavaScript example you can enqueue via a small custom script file:

<script>
document.addEventListener('DOMContentLoaded', function () {
    var content = document.querySelector('.entry-content, .post-content');

    if (!content) {
        return;
    }

    var text = content.innerText || content.textContent;
    if (!text) {
        return;
    }

    var words = text.trim().split(/\s+/).length;
    var wordsPerMinute = 200;
    var minutes = Math.max(1, Math.ceil(words / wordsPerMinute));

    var label = minutes === 1 ? '1 minute read' : minutes + ' minute read';

    var readingTime = document.createElement('p');
    readingTime.textContent = label;

    var title = document.querySelector('.entry-title, .post-title');
    if (title && title.parentNode) {
        title.parentNode.insertBefore(readingTime, title.nextSibling);
    } else {
        content.parentNode.insertBefore(readingTime, content);
    }
});
</script>

In a production environment, you would place this code into its own JavaScript file and enqueue it properly using wp_enqueue_script(), rather than embedding it inline.

Displaying Reading Time in the Block Editor

If you’re using the block editor for template building (with a block theme or the Site Editor), you have more flexible ways to place reading time using patterns, template parts, or custom blocks.

Using a Shortcode with a Classic Block

One quick solution is to register a shortcode in PHP that calls your reading time function:

<?php
function myprefix_reading_time_shortcode() {
    ob_start();
    myprefix_the_reading_time();
    return ob_get_clean();
}
add_shortcode( 'reading_time', 'myprefix_reading_time_shortcode' );
?>

You can then:

  • Add a Shortcode block (or Classic block) at the top of your post template.
  • Insert [reading_time] where you want the estimate to appear.

This gives editors a simple, non-technical way to place reading time anywhere in the content layout.

Integrating with Template Parts

For more advanced setups, you can add a small PHP or HTML template part that prints the reading time and then include that template part in multiple post templates. This is a clean architectural approach if you’re maintaining a custom theme with reusable patterns.

Styling the Reading Time Output

Once your reading time is visible, you may want to adjust its appearance so it integrates smoothly with your design.

Common Design Patterns

Some ideas for styling:

  • Display it in muted text alongside the post date and author.
  • Show it as a small badge or pill near the title.
  • Place it at the top of the content, aligned with category and tags meta.

If your theme supports additional CSS in the Customizer or Site Editor, you can use a minimal selector like:

.post-reading-time {
    font-size: 0.9em;
    opacity: 0.7;
}

Adjust the class name according to the markup you output in your templates or filters.

Best Practices and Performance Considerations

Displaying reading time is straightforward, but a few best practices keep your implementation performant, accurate, and robust.

Accuracy vs. Simplicity

  • Use a reasonable reading speed and stick to it for consistency.
  • Round to whole minutes for readability; most users don’t need seconds.
  • Consider very long articles: for posts above a certain length, you may want to show “15+ minutes” instead of an exact figure.

Performance Tips

  • Avoid heavy computations on every page load: The simple word count approach is fine for most sites, but very large sites with huge posts may want to cache the computed value.
  • Use transients or post meta: You can compute reading time when a post is saved and store it as post meta, then read it directly on the front-end rather than recalculating every time.
  • Be careful with JavaScript: Don’t run expensive DOM operations across too many nodes; target just the main content container.

Localization and Accessibility

  • Wrap labels in translation functions so you can localize them for different languages.
  • Ensure the text color contrast meets accessibility guidelines.
  • Don’t rely solely on icons; always include readable text indicating the estimate.

Advanced Idea: Store Reading Time as Post Meta

If you want maximum efficiency and tight integration with your editorial workflow, computing and storing reading time when authors save content is a powerful approach.

Saving Reading Time on Post Save

Here’s an outline of how that could work:

  • Hook into the save_post action.
  • Calculate the word count and estimated reading time.
  • Store it as a custom field (post meta).

Your front-end then simply reads that meta value instead of recalculating the estimate. This makes templates faster and lets you query posts by reading time if you want to build “quick reads” or “long reads” archives in the future.

Conclusion

Displaying estimated reading time in your posts is an easy win for both readers and site owners. It sets expectations, improves user experience, and supports better engagement metrics that can indirectly help your visibility in search results.

Whether you prefer a quick plugin-based solution, a lean custom PHP implementation, or a JavaScript-based approach for a decoupled front-end, WordPress gives you all the tools to implement reading time in a way that matches your workflow and coding style. Start by choosing the method that fits your current theme and skill level, then refine the wording, placement, and style so it feels like a natural part of your site’s overall design.