Use when auditing a page's heading structure, generating H1 text for landing pages or blog posts, or reviewing a CMS template that may produce empty or missing
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-h1-a1a9dbef801b ,按照其中的说明把「h1」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
The H1 is the most prominent heading on a page and a strong on-page ranking signal. Google uses it to understand the page's primary topic. Missing, duplicate, or keyword-free H1 tags reduce topical clarity, hurting rankings for the page's target terms.
<h1> tag that describes the page's primary topic with relevant keywords<title> tag, but they should be topically consistent<h1> tags, multiple <h1> tags on one page, or H1s containing only the brand name are all issues to fixParse the rendered DOM of each page. Count all <h1> elements. Flag: (1) Pages with zero <h1> tags. (2) Pages with more than one <h1> tag. (3) <h1> elements whose text content is empty or contains only whitespace. (4) <h1> elements that contain only the brand name with no page-specific topic. (5) <h1> text that does not reflect the page's primary content topic.
<h1>.display:none or visibility:hidden).<h1>Acme Corp</h1> (brand only)
After: <h1>Project Management Software for Enterprise Teams</h1>Google's John Mueller has confirmed that H1 tags help Google understand page structure. While H1 is not the strongest ranking factor in isolation, it contributes to on-page topical relevance signals. Multiple H1 tags on one page dilute the primary topic signal; a missing H1 leaves a structural gap that reduces confidence in what the page is about.
Query the DOM for all <h1> elements. Assert exactly one exists per page. Check that innerText.trim() is non-empty. Compare H1 text to the page <title> — they should share core topic keywords. Flag if H1 is inside a <header> element shared across all pages (often the site logo alt text) rather than specific to the page content.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/seo/h1