免费 · SEO
robots.txt 生成器.
生成 robots.txt 的抓取指令,并可选添加站点地图地址。
如何创建 robots.txt 文件
- “User agent”保留
*表示所有爬虫,或输入一个名称,例如Googlebot。 - 在文本框中列出要屏蔽的路径,每行一个,以
/开头,例如/private/或/cart/。留空则允许抓取全部内容。 - 选择“Disallow listed paths”或“Allow listed paths”,填写“Sitemap URL (optional)”,并在“AI crawlers”中选择一项。
- 复制或下载结果,以
robots.txt为文件名上传到域名根目录,例如https://example.com/robots.txt。
输入 /private/ 和站点地图地址后,文件内容为 User-agent: *、Disallow: /private/ 和 Sitemap: https://example.com/sitemap.xml。不填路径时,工具会写入空的 Disallow: 行,表示允许抓取整个网站。路径从 URL 开头开始匹配,所以 /private/ 也包括 /private/files/report.pdf。
AI 爬虫,以及 robots.txt 做不到的事
“Block AI training crawlers (keep AI search)”会为 GPTBot、ClaudeBot、Google-Extended、Applebot-Extended、CCBot、Bytespider 和 Meta-ExternalAgent 添加规则,不影响 AI 搜索爬虫。“Block all AI crawlers”还会屏蔽 OAI-SearchBot、ChatGPT-User、Claude-SearchBot、Claude-User、PerplexityBot、Perplexity-User 和 Amazonbot,可能让你的页面从 AI 回答中消失。若要逐个控制爬虫,请使用 AI robots.txt 生成器。
robots.txt 控制的是抓取,而不是索引或隐私。被屏蔽的页面如果有其他网站链接,仍可能出现在搜索结果中;而且任何人都能读取这个文件,所以不要在里面列出机密目录。要让页面不出现在 Google 中,应允许抓取并添加 noindex 元标签,例如用元标签生成器。要创建文件中引用的站点地图,请用 XML 站点地图生成器。
限制与支持格式
输入内容在您的设备上处理。
英语技术说明
robots.txt controls crawling, not privacy or guaranteed deindexing.
Generate crawl directives and an optional sitemap reference. robots.txt controls crawling, not privacy or guaranteed deindexing. Inputs stay on your device. Review the preview or output before using it; refresh the page to clear the current working session.
Allow crawling and add a sitemap URL.
常见问题
robots.txt 文件应放在哪里?
放在域名根目录,即 https://example.com/robots.txt。爬虫不会在子目录中查找它,每个子域名都需要自己的文件。
Disallow 会把页面从 Google 中删除吗?
不会。它阻止抓取,但被屏蔽的网址仍可能通过链接被收录。要从结果中移除,请在可抓取的页面上使用 noindex 标签。
AI 爬虫会遵守 robots.txt 吗?
大型 AI 公司表示会遵守,但这是自愿的,也有报道称部分爬虫会忽略它。生成的文件会在注释中说明这一点。