参考资料

  1. Bing 管理员工具
  2. robots.txt利用
  3. 百度收录资源平台
  4. robots.txt 生成
  5. robots.txt sitemap
  6. robots.txt文件
  7. robots.txt 语法
  8. 百度收录解析与操作指南

Meta Robots 详解

Meta Robots 详解

1. 什么是 Meta Robots?

<meta name="robots"> 是 HTML 的元标签,用于控制搜索引擎爬虫如何索引和跟踪网页内容。

2. 如何设置 Meta Robots?

在网页的 <head> 部分添加以下代码:

<meta name="robots" content="指令1,指令2">

其中 content 属性可包含多个指令,用逗号分隔。


3. 常用 Meta Robots 指令及示例

指令作用示例
index允许搜索引擎索引该页面<meta name="robots" content="index">
noindex禁止搜索引擎索引该页面<meta name="robots" content="noindex">
follow允许爬虫跟踪页面上的链接<meta name="robots" content="follow">
nofollow禁止爬虫跟踪页面上的链接<meta name="robots" content="nofollow">
none等同于 noindex, nofollow<meta name="robots" content="none">
noarchive禁止搜索引擎缓存页面快照<meta name="robots" content="noarchive">
nosnippet禁止在搜索结果中显示摘要<meta name="robots" content="nosnippet">
notranslate禁止自动翻译该页面<meta name="robots" content="notranslate">
noimageindex禁止索引页面上的图片<meta name="robots" content="noimageindex">
unavailable_after:[date]在指定日期后停止索引<meta name="robots" content="unavailable_after: 31-Dec-2024">

4. 常见组合示例

① 允许索引和跟踪链接(默认)

<meta name="robots" content="index,follow">
<!-- 或直接省略,搜索引擎默认会索引和跟踪 -->

② 禁止索引但允许跟踪链接

<meta name="robots" content="noindex,follow">
<!-- 适用于不想被收录但希望传递权重的页面 -->

③ 允许索引但禁止跟踪链接

<meta name="robots" content="index,nofollow">
<!-- 适用于允许收录但不想传递权重的页面 -->

④ 完全禁止索引和跟踪

<meta name="robots" content="noindex,nofollow">
<!-- 或简写为 -->
<meta name="robots" content="none">

⑤ 禁止缓存和摘要

<meta name="robots" content="noarchive,nosnippet">
<!-- 适用于敏感内容 -->

5. 注意事项

  • 优先级meta robots 的优先级低于 robots.txt,但高于搜索引擎的默认行为。

  • X-Robots-Tag:在 HTTP 头部也可以设置类似规则(适用于动态页面)。

  • 搜索引擎兼容性:大多数主流搜索引擎(Google、Bing、百度)都支持 meta robots


6. 实际应用场景

禁止收录登录页、隐私政策页noindex
允许收录但阻止权重传递index,nofollow
禁止缓存敏感内容noarchive
设置页面过期时间unavailable_after

这样设置后,搜索引擎会按照你的指令处理网页。