{"id":127,"date":"2025-10-10T05:11:49","date_gmt":"2025-10-10T05:11:49","guid":{"rendered":"https:\/\/tronicbazaar.com\/questions\/?p=127"},"modified":"2025-10-10T05:41:06","modified_gmt":"2025-10-10T05:41:06","slug":"how-to-add-estimated-reading-time-to-wordpress-posts-without-any-plugin","status":"publish","type":"post","link":"https:\/\/tronicbazaar.com\/questions\/how-to-add-estimated-reading-time-to-wordpress-posts-without-any-plugin\/","title":{"rendered":"How to Add Estimated Reading Time to WordPress Posts Without Any Plugin"},"content":{"rendered":"\n<h3 class=\"wp-block-heading has-large-font-size\"><strong>Step 1. Create a child theme<\/strong><\/h3>\n\n\n\n<h1 class=\"wp-block-heading has-large-font-size\"><strong>Step 2. Add this code to functions.php of your child theme <\/strong><\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Display Estimated Reading Time for WordPress Posts\nfunction at_estimated_reading_time($content) {\n    if (is_single()) {\n        $word_count = str_word_count(strip_tags($content));\n        $words_per_minute = 200; \/\/ average reading speed\n        $minutes = ceil($word_count \/ $words_per_minute);\n        \n        $label = ($minutes &lt;= 1) ? '1 min read' : \"$minutes min read\";\n\n        \/\/ Design your layout\n        $reading_time_html = '&lt;div class=\"reading-time\"&gt; ' . esc_html($label) . '&lt;\/div&gt;';\n        return $reading_time_html . $content;\n    }\n    return $content;\n}\nadd_filter('the_content', 'at_estimated_reading_time');\n\n\/\/ Optional: Style your reading time box\nadd_action('wp_head', function() {\n    echo '\n    &lt;style&gt;\n    .reading-time {\n        font-size: 14px;\n        font-weight: 500;\n        color: #555;\n        margin-bottom: 8px;\n        background: #f6f7f9;\n        display: inline-block;\n        padding: 4px 10px;\n        border-radius: 6px;\n    }\n    &lt;\/style&gt;';\n});\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: How It Works<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It counts the number of <strong>words<\/strong> in your post.<\/li>\n\n\n\n<li>Divides by average reading speed (\u2248200 words\/min).<\/li>\n\n\n\n<li>Displays a small \u201c X min read\u201d block before your content.<\/li>\n\n\n\n<li>Automatically applies to <strong>all single posts<\/strong>, no shortcode needed.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><strong>Step 3: (Optional) Move It Below Title Instead of Content<\/strong><\/h3>\n\n\n\n<p>This will place it neatly right below the post title.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Show Reading Time Below Post Title\nfunction at_show_reading_time_title() {\n    if (is_single()) {\n        global $post;\n        $content = apply_filters('the_content', $post-&gt;post_content);\n        $word_count = str_word_count(strip_tags($content));\n        $minutes = ceil($word_count \/ 200);\n        $label = ($minutes &lt;= 1) ? '1 min read' : \"$minutes min read\";\n        echo '&lt;div class=\"reading-time\"&gt; ' . esc_html($label) . '&lt;\/div&gt;';\n    }\n}\nadd_action('the_title', 'at_show_reading_time_title');\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4. To style it add this code to your child themes css<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>.reading-time {\n  font-size: 13px;\n  color: #999;\n  margin-top: 6px;\n  display: block;\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why Add Reading Time ?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li> <strong>Improves UX:<\/strong> Visitors know what to expect before reading. <strong>Boosts dwell time:<\/strong> Readers stay longer when they see a short read ahead.<\/li>\n\n\n\n<li><strong>SEO Friendly:<\/strong> Google rewards better user engagement metrics.<\/li>\n\n\n\n<li><strong>Professional feel:<\/strong> Adds that \u201cmodern blog\u201d vibe instantly.<\/li>\n<\/ul>\n\n\n\n<p>Adding reading time to your WordPress posts is a <strong>simple but powerful trick<\/strong>.<br>It takes less than a minute to set up and instantly improves <strong>UX + SEO metrics<\/strong> \u2014 a win-win for every blogger or developer-focused site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1. Create a child theme Step 2. Add this code to functions.php of your child theme Step 2: How It Works Step 3: (Optional) Move It Below Title Instead of Content This will place it neatly right below the post title. Step 4. To style it add this code to your child themes css [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[21,22,23],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-wordpress-tips-tricks","tag-google-discover-tips-tricks","tag-seo-tips-tricks","tag-wordpress-seo"],"_links":{"self":[{"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":6,"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/posts\/127\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tronicbazaar.com\/questions\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}