Use when auditing HTML document structure. Applies to any page where meta tags (noindex, canonical-url, description, viewport, OG tags) may have been injected i
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-meta-in-body-c88e43310cb0 ,按照其中的说明把「meta-in-body」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Meta tags placed in the document body are ignored by search engines and most browsers—directives like noindex or canonical-url are silently ineffective, causing pages to be indexed or de-indexed unexpectedly.
Parse the HTML and check whether any elements appear outside —i.e., inside or after the closing tag. Flag each misplaced tag by name/property.
Move all tags into the section before . If they are injected by a script after the DOM is built, refactor the injection to target document.head instead of document.body.
Meta tags are document-level metadata and must live in . When placed in , they fall outside the metadata model of the document—search engines and browsers do not honour them, so directives like noindex or canonical-url will have no effect.
Parse the rendered HTML and check the DOM structure. Find all elements. For each one, traverse up the parent chain — if any ancestor is or if the element appears after in the source, flag it. Pay special attention to: meta name='robots', meta name='description', meta property='og:*', and link rel='canonical' placed in body.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/seo/meta-in-body