Step 1. Create a child theme
Step 2. Add this code to functions.php of your child theme
// Display Estimated Reading Time for WordPress Posts
function at_estimated_reading_time($content) {
if (is_single()) {
$word_count = str_word_count(strip_tags($content));
$words_per_minute = 200; // average reading speed
$minutes = ceil($word_count / $words_per_minute);
$label = ($minutes <= 1) ? '1 min read' : "$minutes min read";
// Design your layout
$reading_time_html = '<div class="reading-time"> ' . esc_html($label) . '</div>';
return $reading_time_html . $content;
}
return $content;
}
add_filter('the_content', 'at_estimated_reading_time');
// Optional: Style your reading time box
add_action('wp_head', function() {
echo '
<style>
.reading-time {
font-size: 14px;
font-weight: 500;
color: #555;
margin-bottom: 8px;
background: #f6f7f9;
display: inline-block;
padding: 4px 10px;
border-radius: 6px;
}
</style>';
});
Step 2: How It Works
- It counts the number of words in your post.
- Divides by average reading speed (≈200 words/min).
- Displays a small “ X min read” block before your content.
- Automatically applies to all single posts, no shortcode needed.
Step 3: (Optional) Move It Below Title Instead of Content
This will place it neatly right below the post title.
// Show Reading Time Below Post Title
function at_show_reading_time_title() {
if (is_single()) {
global $post;
$content = apply_filters('the_content', $post->post_content);
$word_count = str_word_count(strip_tags($content));
$minutes = ceil($word_count / 200);
$label = ($minutes <= 1) ? '1 min read' : "$minutes min read";
echo '<div class="reading-time"> ' . esc_html($label) . '</div>';
}
}
add_action('the_title', 'at_show_reading_time_title');
Step 4. To style it add this code to your child themes css
.reading-time {
font-size: 13px;
color: #999;
margin-top: 6px;
display: block;
}
Why Add Reading Time ?
- Improves UX: Visitors know what to expect before reading. Boosts dwell time: Readers stay longer when they see a short read ahead.
- SEO Friendly: Google rewards better user engagement metrics.
- Professional feel: Adds that “modern blog” vibe instantly.
Adding reading time to your WordPress posts is a simple but powerful trick.
It takes less than a minute to set up and instantly improves UX + SEO metrics — a win-win for every blogger or developer-focused site.