# WordCount
> 返回给定页面内容中的单词数。
- 官方英文原文：https://gohugo.io/methods/page/wordcount/
- 本页规范地址：https://hugozh.cn/methods/page/wordcount/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：PAGE.WordCount
- 返回类型：int
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
```go-html-template
{{ .WordCount }} → 103
```

要向上取整到最接近的 100 的倍数，请使用 [`FuzzyWordCount`][] 方法。

> [!NOTE]
> 对于 [CJK](g) 语言的内容，请在项目配置中把 [`hasCJKLanguage`][] 设为 `true`。启用后，Hugo 会对含 CJK 字符的页面应用 CJK 计数规则。要针对某个页面覆盖该行为，请在其前置元数据中设置 [`isCJKLanguage`][] 字段。

[`FuzzyWordCount`]: /methods/page/fuzzywordcount/
[`hasCJKLanguage`]: /configuration/all/#hascjklanguage
[`isCJKLanguage`]: /content-management/front-matter/#iscjklanguage

