跳到正文
Skillpedia
SEO75k · #3005

robots-txt

它能做什么

这个技能检查网站根目录的 robots.txt 文件,确保它有效且没有屏蔽整个网站。它面向希望搜索引擎能访问其内容的网站所有者。

适用场景

  • ✓你请智能体为网站创建或检查 robots.txt 文件的时候。
  • ✓网站从搜索中消失,而你怀疑 robots.txt 中有屏蔽规则的时候。
  • ✓你上线新网站,并希望有一个干净的 robots.txt 并链接站点地图的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/robots-txt/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/robots-txt/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我检查 robots.txt 文件,确保它没有屏蔽我的网站,并指向我的站点地图吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会获取 robots.txt 文件,检查它是否返回正常响应以及指令是否正确。它会查找意外屏蔽整个网站的情况,并添加指向正式站点地图的 Sitemap 行。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Publish a robots.txt file

robots.txt is the first file crawlers fetch; misconfigured directives can silently block search engines from crawling your entire site, killing organic visibility.

Quick Reference

  • Serve a valid robots.txt at /robots.txt on the production domain, returning HTTP 200
  • Include a Sitemap: directive pointing to your XML sitemap
  • Never disallow crawling of CSS/JS assets that render your pages
  • Avoid blocking all crawlers with Disallow: / on a live site

Check

Fetch /robots.txt on the live domain and verify it returns HTTP 200, uses correct User-agent / Disallow / Allow syntax, and includes a Sitemap: directive pointing to the XML sitemap. Check for accidental Disallow: / directives.

Fix

Create or update robots.txt at the web root with valid directives. Add a live Sitemap: line for the production sitemap URL. Remove any Disallow: / rules that block the whole site or resources needed for rendering.

Explain

Explain how robots.txt controls crawler access, why an accidental Disallow: / can delist a site, and why CSS/JS must remain accessible for rendering-based indexing.

Code Review

Review metadata generation, rendered HTML, structured data, and response headers related to Publish a robots.txt file. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/robots-txt

常见问题

如果 robots.txt 屏蔽了所有内容会怎样?

这个技能说,意外地对整个网站使用 Disallow 可能会使网站从搜索中消失。

应该屏蔽 CSS 和 JavaScript 吗?

不应该。这个技能说,这些文件必须可以访问,以便搜索引擎渲染页面。

robots.txt 能控制索引吗?

它控制的是抓取。这个技能解释说,控制索引要在页面上使用 noindex 标签。

详情

作者的原始描述

Use when applies to any public website. Use when auditing technical SEO foundations or diagnosing crawl coverage gaps.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#3005
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能