在线免费Robots.txt生成器
为您的网站创建优化的robots.txt文件。
Who uses the Robots.txt生成器?
- 希望控制网站哪些部分可被爬虫访问的网站所有者。
- 从网站上线之初就配置正确 robots.txt 的 SEO 专业人员。
- 为预发布环境设置屏蔽所有搜索引擎索引的开发者。
How the Robots.txt生成器 works
勾选要配置的爬虫(Googlebot、Bingbot、GPTBot、ClaudeBot 或 All bots)。
输入 Disallow 路径,每行一个——这些规则会应用于所有勾选的爬虫。
输入你的站点地图网址,将其加入生成的文件中。
复制生成的 robots.txt,上传到你网站的根目录。
Tips & tricks
- 同一组 Disallow 路径会应用于你勾选的所有爬虫——如果需要针对不同爬虫设置不同规则,请为每个爬虫分别生成一次文件,再手动合并各个 User-agent 代码块。
- 本工具没有 Allow 指令——如果需要,可在复制结果后手动添加。
- 对大多数网站来说,勾选“All bots (*)”通常就够了——按爬虫单独设置规则主要用于想屏蔽某个爬虫(例如某个 AI 爬虫)同时允许其他爬虫的情况。
- 在生产环境依赖生成的 robots.txt 之前,先用 Google 搜索控制台的 robots.txt 测试工具测试一下。
Frequently Asked Questions
robots.txt 有什么作用?
robots.txt 是位于你网站根目录的一个文件,用来告诉网络爬虫哪些页面应该访问、哪些不应该访问。它遵循 Robots 排除标准——遵守该标准的爬虫会遵循你设置的规则。
这个工具支持 Allow 规则,还是只支持 Disallow?
只支持 Disallow。大多数爬虫默认会把未被禁止的路径视为允许访问,因此很少需要显式的 Allow 规则——但如果你确实需要(例如允许被禁止目录下的某个子路径),可以在生成的结果中手动添加。
robots.txt 能阻止页面出现在搜索结果中吗?
不能。在 robots.txt 中禁止某个网址只能阻止其被抓取,但如果其他网站链接到该网址,它仍可能出现在搜索结果中。要阻止索引,需要在页面本身使用 meta robots 的“noindex”标签。
robots.txt 中通常应该禁止哪些内容?
常见的排除项:/admin/、/wp-admin/、/login/、/private/、/cart/、/checkout/、/account/、/thank-you/,以及重复内容路径。切勿禁止 CSS 和 JS 文件——Googlebot 需要它们来渲染你的页面。
robots.txt 是一种安全工具吗?
不是。任何不遵守规则的爬虫(恶意抓取工具、内容盗用者)都会无视你的 robots.txt。切勿依赖 robots.txt 来保护敏感网址——应改用服务器端身份验证和访问控制。
Is my data safe when using the Robots.txt生成器?
Completely safe. The Robots.txt生成器 processes everything locally in your browser. No input data, results, or usage information is ever transmitted to or stored on any server.
Can I use the Robots.txt生成器 output in commercial projects?
Yes. The Robots.txt生成器 is a utility tool and its output carries no licensing restrictions. You are free to use results in any project, commercial or personal.
Does the Robots.txt生成器 follow official standards?
Yes. The Robots.txt生成器 is built to comply with the relevant industry standard or specification for this utility type. If you encounter an unexpected result, verify your input against the specification — edge cases outside the standard may produce undefined behaviour.