知识库 / 阶段 1 · SEO 基础概念 / 搜索引擎优化(SEO) ↗ / 第 075 节
meta robots 应该怎么设置
“meta robots 标签” 是 SEO 中一个非常重要的“抓取与索引控制”工具,
它告诉搜索引擎——这个页面能不能被索引、能不能跟踪链接、要不要出现在搜索结果中。
下面我来系统地讲解:
🤖 一、什么是 meta robots?#
meta robots 是写在网页 <head> 区域的一个 HTML 元标签,
用于向搜索引擎的“爬虫(robots)”发出抓取与索引指令。
📘 基本语法:
<meta name="robots" content="noindex, nofollow">
它不会影响用户浏览,只对搜索引擎起作用。
🧭 二、meta robots 的主要属性说明#
| 指令 | 含义 | 适用场景 |
| index | 允许搜索引擎收录页面 | 默认值 |
| noindex | 禁止页面被收录(不会出现在搜索结果中) | 临时页面、隐私页、后台页 |
| follow | 允许爬虫跟踪并传递链接权重 | 默认值 |
| nofollow | 禁止爬虫跟踪页面上的链接 | 广告页、低质量外链页 |
| noarchive | 禁止搜索引擎显示“网页快照” | 更新频繁或敏感内容页 |
| nosnippet | 禁止展示摘要(Description)或内容片段 | 隐私、版权内容 |
| noimageindex | 禁止图片出现在图片搜索中 | 隐私类图片 |
| nocache | 禁止缓存(类似 noarchive) | 安全类页面 |
| max-snippet | 限制摘要长度(像素单位) | 控制搜索展示内容量 |
🧩 三、常见配置示例#
✅ 1. 正常可收录页面(默认)#
<meta name="robots" content="index, follow">
说明:允许索引,也允许权重传递。
(其实可以省略,因为搜索引擎默认是 index, follow)
🚫 2. 禁止收录,但允许传递权重#
<meta name="robots" content="noindex, follow">
适合:
-
会员中心、搜索结果页;
-
不希望被索引,但希望外链仍能传递权重。
🚫 3. 禁止抓取与传递链接权重#
<meta name="robots" content="noindex, nofollow">
适合:
-
后台、测试页;
-
敏感信息或临时页面。
📷 4. 禁止图片收录#
<meta name="robots" content="noimageindex">
适合:
- 产品私密图、版权图片。
⚙️ 5. 禁止网页快照与摘要#
<meta name="robots" content="noarchive, nosnippet">
适合:
- 内容经常变化、或版权受保护的网站。
💡 四、meta robots 与 robots.txt 的区别#
| 对比项 | meta robots | robots.txt |
| 作用范围 | 单个网页级别 | 整站或目录级别 |
| 控制对象 | 页面索引与链接传递 | 爬虫抓取访问 |
| 放置位置 | HTML <head> 内 | 网站根目录下 |
| 生效时机 | 页面被访问后生效 | 在访问前生效 |
| 精准程度 | 精细控制 | 粗略控制 |
👉 简单理解:
-
robots.txt 是“爬虫能不能来”;
-
meta robots 是“来了以后能不能收录和传权重”。
⚠️ 五、使用注意事项#
| 注意点 | 说明 |
| ❌ 不可误用 noindex | 否则页面将被完全移出搜索结果 |
| ✅ 区分“禁止抓取”和“禁止收录” | Robots.txt 禁止抓取的页面,无法执行 meta robots 中的 noindex |
| ✅ 确认放置位置正确 | 必须放在 <head> 内,且在 <title> 之前或之后均可 |
| ✅ 区分大小写 | name="robots" 小写才有效 |
| ✅ 针对不同爬虫可单独设置 | 例如:<meta name="googlebot" content="noindex"> |
🔍 六、实战案例#
案例1:隐藏登录页#
<meta name="robots" content="noindex, nofollow">
案例2:不希望出现在搜索结果,但保留权重传递#
<meta name="robots" content="noindex, follow">
案例3:防止百度快照显示旧内容#
<meta name="robots" content="noarchive">
<meta name="baiduspider" content="noarchive">
案例4:控制特定爬虫#
<meta name="googlebot" content="noindex, follow">
<meta name="baiduspider" content="index, follow">
🧠 七、常见错误配置及后果#
| 错误示例 | 问题说明 | 后果 |
| <meta name="robots" content="noindex, nofollow"> | 误加在重要页面(如首页) | 全站被移出搜索结果 |
| <meta name="robots" content="none"> | 等价于 noindex, nofollow | 页面彻底失效 |
| 放在 <body> 中 | 搜索引擎无法识别 | 指令无效 |
| 拼写错误(如 robot / robtos) | 无效标签 | 不生效 |
🧾 八、检查与验证方法#
| 工具 | 功能 |
| Google Search Console | 查看被 noindex 的页面报告 |
| Screaming Frog SEO Spider | 批量抓取 meta robots 设置 |
| Ahrefs / Semrush | 检查被禁止索引的页面 |
| 浏览器 → 查看源代码 | 搜索 “meta name="robots"” |
✅ 九、一句话总结#
meta robots = 网页的“搜索引擎准入证”。
它决定了——
这个页面能不能被收录、能不能传权重、能不能展示摘要。
正确使用 meta robots:
-
能有效保护隐私页;
-
保证 SEO 权重集中;
-
提高网站结构清晰度与抓取效率。