How to automatically calculate and display article reading time with Webflow CMS

Written by
John Doe
Published on
2025-10-19

table of contents

Some people use Webflow's CMS to manage blog postsI want to automatically display “This article can be read in ◯ minutes” I think there are many people who think that.

This time How to automatically calculate article reading time using JavaScript and display it dynamically on Webflow pages I will explain it to you.

I'll explain it in detail, including the process of actually implementing it through trial and error, so be sure to check it out!

1. Step 1: Review the article structure

First, check how the main text of the article is arranged in Webflow's CMS.

Necessary elements:

  • Includes the main text of the article .article-content Let's check out the rich text blocks in the class. This is the part that shows the main content of the article.

1-1. Setup procedure in Webflow

  1. Open Webflow's Designer (design editor)
  2. Go to the CMS collection page(blog post template pages, etc.)
  3. Select a rich text block to display the article text
  4. “Class” .article-content Set to(check only if you already have one)

1-2. How to check the elements in the article text

  1. Publish the page or open preview
  2. Open the browser's development tools (F12 key)
  3. On the Elements tab .article-content Search
  4. Check if the text of the article is correct

Also, display the reading time .reading-time-container It's called Div Place the element within the page. This element is for dynamically inserting reading times calculated using JavaScript.

First, in Webflow design mode .reading-time-container Add it and place it in an appropriate position. For example, something just below the article title is appropriate.

Development tools (F12) is used to create the main text of the article .article-content Let's check that it's applied to.

console.log("記事本文:", document.querySelector(".article-content"));

run this code in the console,null Instead, it's OK if the rich text block HTML is displayed.

2. Step 2: Calculate reading time with JavaScript

To dynamically display read time on Webflow pages, use JavaScript.

To calculate reading time,Generally read about 500 characters per minute We will adopt this assumption.

2-1. initial implementation(basic reading time calculation)

This script is Webflow's “Before </body> Tags” area If you add to, when the page loads Calculate the number of characters in the main text of the article and read it time .reading-time-container Insert into You can do it.

document.addEventListener("DOMContentLoaded", function () {
    let articleContent = document.querySelector(".article-content");
    let readTimeContainer = document.querySelector(".reading-time-container");

    if (articleContent && readTimeContainer) {
        let text = articleContent.innerText.trim();
        let charCount = text.length;
        let readingSpeed = 500;
        let readingTime = Math.ceil(charCount / readingSpeed);
        readTimeContainer.textContent = `この記事は約 ${readingTime} 分で読めます。`;
    }
});
    }
});

3. Step 3: Address Webflow CMS load delays

In Webflow Since CMS data is loaded asynchronously, the article text hasn't been loaded yet when the script is executed There is something.

To resolve this issue,A process that waits for up to 5 seconds (100ms x 50 times) for an article to load I will add it.

3-1. Revised JavaScript (optimized version for Webflow)

document.addEventListener("DOMContentLoaded", function () {
    let articleContent = document.querySelector(".article-content");
    let readTimeContainer = document.querySelector(".reading-time-container");

    if (articleContent && readTimeContainer) {
        let text = articleContent.innerText.trim();
        let charCount = text.length;
        let readingSpeed = 500;
        let readingTime = Math.ceil(charCount / readingSpeed);
        readTimeContainer.textContent = `この記事は約 ${readingTime} 分で読めます。`;
    }
});
        readTimeContainer.style.display = "block";
        readTimeContainer.style.visibility = "visible";
        console.log("✅ 読了時間が設定されました:", readTimeContainer.textContent);
    }

    function observeContentChanges(articleContent, readTimeContainer) {
        let observer = new MutationObserver(() => {
            let text = articleContent.innerText.trim();
            let charCount = text.length;
            if (charCount > 0) {
                updateReadingTime(charCount, readTimeContainer);
            }
        });

        observer.observe(articleContent, { childList: true, subtree: true, characterData: true });
        observer.observe(readTimeContainer, { childList: true, subtree: true, characterData: true });
    }
});

4. Step 4: Debug when the read time is not displayed

4-1. .reading-time-container I can't find it

Check if the element is present by running the following command in the console.

console.log(document.querySelector(".reading-time-container"));

If null, the element doesn't exist on the page So, on Webflow .reading-time-container Please add it correctly.

4-2. Make sure it's not hidden in CSS

Run the following code and test whether the elements are displayed correctly.

document.querySelector(".reading-time-container").style.display = "block";document.querySelector(".reading-time-container").style.visibility = "visible";

4-3. Confirm retrieval of article text

console.log(document.querySelector(".article-content")?.innerText);

If the article text can be obtained here, there is a high possibility that the script is working properly.

5. Summary

To automatically display the reading time in Webflow CMS, calculate the number of characters in the article using JavaScript
Wait up to 5 seconds to support Webflow's delayed loading setInterval Make use of
.reading-time-container Make sure the settings are correct and check the effects of CSS
Use MutationObserver to respond even when the content of an article changes

Relation

関連記事

This is some text inside of a div block.

Thorough explanation of how to use Google Antigravity | Towards an age where anyone can develop apps with AI

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

When I made an AI that automatically writes medical articles, it hit an unexpected wall

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

A story about how I decided to quit “round throwing” on that day when advertising expenses of 4 million yen a month disappeared

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Let's talk about the case where the new features announced at Webflow Conf 2025 are dangerous from a field perspective

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[Breaking News] Claude Code on the Web is here! Next-generation AI coding starting with browsers and smartphones has arrived!

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

A story about the “future” of web production that I felt when I participated in Webflow Conf 2025

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Do Google Business Profile Posts Really Increase Search Rankings? Explain survey results in an easy-to-understand manner

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

I tried making use of Hawkins's author “Power or Force” on the sales page

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

The complete guide to MCP Toolbox for Databases! An innovative tool to securely link AI agents with databases

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

The future that Google's ApertureDB will change! Understanding the Next Generation Database Revolution with Familiar Examples

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Google's latest technology “MUVERA”! A new-age algorithm that fundamentally changes the search experience

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

SEO strategies in the AI era! In response to the evolution of search engines, I will talk about the importance of GEO using the example of attracting customers to treatment centers

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

AI is changing advertising! Google AI Max for Search Campaign and the Future of Advertising

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

What is query fan-out? The future of search changed by Google's AI Mode and how to understand it with familiar examples

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

What is the new trend “LLMO countermeasures” in the generative AI era? Essential strategies for your website to survive

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

What content is being read and evaluated? Learn the secrets of SEO writing from search intent

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[Actual experience] Production time reduced to 1/3 with Webflow AI! The new common sense of creating “sellable” sites without code

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

How to Learn Web Production Efficiently - Optimal Learning Methods Based on Brain Science

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Do I need coding with Webflow? Thorough explanation of what can and cannot be done with No Code

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

The secret to effective ad copywriting that puts consumer sentiment on your side

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[GA4 alone isn't enough?] A thorough comparison of eBIS vs Usermaven access analysis tools!

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

One way to transform marketing! Efficiency and automation realized by linking Webflow and Clay

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Elementor Pro Complete Utilization Guide 2025! Thorough explanation from customization to operation

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

How to automatically calculate and display article reading time with Webflow CMS

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

No more hesitation! How to increase site customer attraction with Webflow SEO measures

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[2024 update] What is GSAP? The Future of Animation Production Will Change with Webflow Integration | Full Explanation

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

WordPress challenges and WebFlow benefits! The results of analyzing the benefits of migration...

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Extract data from your entire website with Firecrawl! Thorough explanation of basic understanding and usage

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[Latest Edition] Must-See Plugins List to Power Up Your Webflow Site

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[2024 Edition] Explaining how to use Elementor for beginners! Build a full-scale site with WordPress

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[Website production cost] Market price and breakdown as seen from actual examples

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Even beginners can earn 50,000 a month! How to start web production as a side job?

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Use your AI skills as a side job! 11 ways that even beginners can challenge are revealed to the public

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Realized with no-code technology! What future entrepreneurs should know about digital innovation

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

[From price to features] Comparative analysis between WebFlow and Studio! Which one should I choose?

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Get creative freedom with the Webflow code output feature

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Basic usage and features of Microsoft Copilot Studio

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

How to create a concept - the secrets of design that captivates customers

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

This is all you need to read to create a piano classroom website! Strategies for success and 5 case studies

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

New OpenAI feature: GPT customization

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Beginner's Guide to Prompt Engineering

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Build a website with Webflow! Anyone can easily create a site without coding

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Advantages of UI design using Webflow

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

The Evolution of Webflow: New Possibilities for Design, Development, and Collaboration

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Applied Skills in the AI Era: Experience Strategy and Prompt Design

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Powering up your website with Webflow: Fivetran customer stories

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

How to create a website to express yourself

This is some text inside of a div block.
7 min read
This is some text inside of a div block.

Responding to a Changing Market: A Global Consulting Firm's Perspective

This is some text inside of a div block.
7 min read

Let's start with a free consultation

I'm very sorry. Our resources are limited, and in order to provide high quality services to each company, we are currently offering this special condition (full refund guarantee+free consultation), limited to [first 5 companies per month].

Furthermore, only for those who have applied for a free consultation, we will give you a free “competitor site analysis & improvement proposal report” usually worth 50,000 yen only for those who have applied for a free consultation.

There is a possibility that the slots will fill up quickly, so please apply as soon as possible.

I agree to the privacy policy and first conduct a free consultation
Thank you! Your submission has been received!
Oops! Something went long while appearing the form.