在线免费Robots.txt测试器
测试您的robots.txt是否允许或阻止爬虫访问特定路径。
Paste your robots.txt content below, then optionally test a path against a user-agent.
Who uses the Robots.txt测试器?
- 在部署之前粘贴 robots.txt 草稿以验证更改不会意外阻止重要页面的 SEO 专员。
- 确认其 CMS 生成的 robots.txt 允许搜索引擎抓取内容的开发者。
- 通过检查 Disallow 规则匹配情况来排查为何特定页面未出现在 Google 搜索结果中的网站所有者。
How the Robots.txt测试器 works
将您的 robots.txt 内容粘贴到文本区域中——没有实时 URL 抓取功能,因此请先复制原始文件内容。
在路径字段中输入要测试的 URL 路径(例如 /admin/login)。
在自由文本的代理字段中输入要模拟的用户代理(例如 Googlebot、Bingbot,或使用 * 表示所有爬虫)——留空则默认使用 *。
点击 Test Path,使用 Google 的最长匹配优先规则,查看该路径是被允许还是被禁止。
Tips & tricks
- 没有实时 URL 抓取功能,也没有批量模式——请手动粘贴 robots.txt 内容,并一次测试一个路径。
- user-agent 字段为自由文本,而非下拉菜单——请准确输入您想模拟的代理名称(例如 Googlebot),或留空以使用通配符 *。
- 该工具应用的是 Google 的最长匹配优先规则,而不是 Bing 的首次匹配优先规则——对于重叠的 Allow/Disallow 规则,结果可能与 Bing 的实际行为不同。
- 您 robots.txt 中的 Sitemap: 行会被解析,并与规则总数和检测到的用户代理一起显示在摘要面板中。
Frequently Asked Questions
我可以输入网站 robots.txt 的网址而不是粘贴其内容吗?
不可以——此工具只解析您直接粘贴的文本。请访问您 robots.txt 的网址,复制其内容,然后粘贴到文本区域。
robots.txt 测试工具是如何工作的?
测试工具会解析您粘贴的 robots.txt 内容,识别适用于您输入的用户代理的规则,并根据这些规则评估路径——使用“最长匹配规则获胜”的原则——返回 Allowed 或 Disallowed。
Allow 与 Disallow 规则的优先顺序是什么?
Google 使用最具体的规则(最长匹配路径),这正是此工具所实现的方式。例如:Disallow: /private/ 和 Allow: /private/public/ —— 对于 /private/public/page,Allow 规则获胜,因为它更具体。Bing 则使用第一个匹配的规则,此工具并未复制这一行为。
我可以一次测试多个 URL 路径吗?
不可以——没有批量测试模式。请通过更改路径字段并再次点击 Test Path 来逐一测试路径。
Disallow 规则是否会阻止某个 URL 出现在搜索结果中?
不一定。禁止某个 URL 会阻止 Googlebot 抓取它,但如果其他网站链接到该 URL,Google 仍可能以有限的信息将其编入索引。要完全防止编入索引,请在页面本身使用 meta robots noindex 标签。
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.
How current is the data returned by the Robots.txt测试器?
The Robots.txt测试器 fetches live data in real time each time you run it. Results reflect the current state of the server or domain at the moment of the request.
Why does the Robots.txt测试器 sometimes return different results than other tools?
Results depend on the real-time state of the target server and DNS propagation, which can vary by geographic region and caching TTL. If you see inconsistencies, wait a few minutes and re-test — DNS changes can take up to 48 hours to propagate fully worldwide.