robots.txt 生成
UpBox优盒工具箱,免费在线 robots.txt 生成工具,支持 User-agent、Allow / Disallow 路径、Crawl-delay 与 Sitemap 声明,规则实时预览,可直接下载部署。
无需注册 · 数据不上传No sign-up · nothing uploaded
抓取规则Crawl rules
路径规则0
禁止路径0
总行数0
robots.txtrobots.txt
robots.txt 已生成
robots.txt 只约束抓取,不保证不被收录;请勿屏蔽 CSS、JS 与图片目录
本工具所有运算在本地浏览器完成,你的文件、文本不会上传到服务器
工具介绍
选择抓取策略后填入路径,工具会按标准语法输出 `User-agent`、`Allow`、`Disallow`、`Crawl-delay` 与 `Sitemap`,路径缺少斜杠会自动补全。 Pick a policy and enter paths; the tool writes User-agent, Allow, Disallow, Crawl-delay and Sitemap lines and adds a missing leading slash.
适合上线前快速生成或核对 robots.txt,改完立刻复制或下载部署到站点根目录。 Use it to draft or check robots.txt before launch, then copy or download it to the site root.
- 三种策略Three policies
- 路径自动补全Path normalization
- Sitemap 声明Sitemap line
- 实时行数统计Live line stats
- 本地处理Local processing
使用说明
- 选择允许全部、禁止全部或自定义。Choose allow all, block all or custom.
- 自定义时按行填写 Allow / Disallow 路径。For custom, list Allow / Disallow paths one per line.
- 填写 Sitemap 地址与可选的 Crawl-delay。Add the sitemap URL and optional crawl delay.
- 复制或下载 robots.txt 放到根目录。Copy or download robots.txt into the site root.
常见问题
Disallow 能阻止收录吗?Does Disallow prevent indexing?
不能完全阻止。被禁止抓取的 URL 仍可能因外链被收录,敏感页面请加 noindex 或鉴权。Not fully. A disallowed URL can still be indexed from links; use noindex or auth for sensitive pages.
为什么要写 Sitemap?Why declare a Sitemap?
帮助爬虫发现全部页面,尤其是内链较少的深层工具页。It helps crawlers find every page, especially deep tool pages with few internal links.
通配符怎么写?How do wildcards work?
`*` 匹配任意字符,`$` 匹配结尾,例如 `/*.pdf$`。Use * for any characters and $ for the end, e.g. /*.pdf$.
会影响已有收录吗?Will it drop existing rankings?
新增 Disallow 只会减少抓取,不会主动删除已收录页面。New Disallow rules reduce crawling but do not remove already indexed pages.