HTML robots 标签参考
robots meta 控制搜索引擎索引和跟踪行为。
语法
<meta name="robots" content="noindex,nofollow">
最小示例
document.querySelector('meta[name="robots"]')?.content;
常见错误
- 只看语法不看运行环境限制。
- 没有处理错误、权限或兼容性分支。
- 示例上线前应结合真实浏览器、服务器或 Git 仓库验证。
robots meta 控制搜索引擎索引和跟踪行为。
<meta name="robots" content="noindex,nofollow">
document.querySelector('meta[name="robots"]')?.content;