键盘
键盘敲击者楼主
robots.txt 不是阻止索引的手段,而是控制抓取。要阻止索引用 noindex meta 标签或 X-Robots-Tag header。常见的 robots.txt 配置:允许所有页面、禁止 /admin、禁止 /api、指向 sitemap.xml。 Schema.org 类型选择:博客文章用 Article(必须有 author/datePublished),产品页用 Product + AggregateOffer(不要用 Offer + price:0),FAQ 用 FAQPage(必须有 Question/Answer 数组)。选错类型会导致 Rich Results 不显示。 Google 抓取预算对大站很重要。优化方法:① robots.txt 禁止低价值页面 ② 用 noindex 阻止索引但不阻止抓取 ③ 优化内链结构让重要页面更易到达 ④ 删除或合并薄内容页面 ⑤ 监控 Search Console 的抓取统计。 JSON-LD 是 Google 推荐的结构化数据格式。博客文章用 Article 类型,产品页用 Product + AggregateOffer,FAQ 用 FAQPage。用 Next.js 可以在 Server Component 中直接渲染 script 标签,不需要客户端注入。