In website operation, we all hope to provide visitors with the best possible browsing experience.One feature that seems trivial but can significantly improve user satisfaction is to estimate the time required for users to read the article details page.This not only helps visitors quickly determine if they have enough time to read the entire content, but also effectively improves the completion rate of the article, thereby indirectly optimizing the user engagement of the website.

The Anqi CMS is a comprehensive and highly flexible content management system that provides powerful template tags and filters, making it very easy to implement this feature.Below, let's take a step-by-step look at how to estimate the reading time for your visitors on the article detail page of AnQiCMS.

The basis of understanding the estimation of reading time: word count and average reading speed

To estimate the reading time of an article, we need two core data: the total number of words (or characters) in the article and a preset average reading speed.

  1. How to get the total number of characters (or character count) of an article:In AnQi CMS, the main content of an article is usually stored inContentfield. We can access it byarchiveDetailLabel gets the value of this field. Even better, AnQi CMS has built-in a namedwordcountA template filter that can directly count the number of words (or word count) in text content, it can accurately handle both Chinese and English content.

  2. Setting of average reading speed:About the average reading speed, it is generally believed that the reading speed of adults is about 200 to 300 words per minute