indexing - 防止搜索引擎索引我的 api

标签 indexing seo meta google-console-developer

我的 api 位于 api.website.com,不需要身份验证。

我正在寻找一种方法来禁止 Google 索引我的 API。

有办法吗?

我的机器人中已经禁止了 api.website.com/robots.txt 但这只会阻止谷歌抓取它。

User-agent: *
Disallow: /

通常的方法是删除 Disallow 并添加 noindex 元标记,但它是一个 API,因此没有元标记或任何内容。

还有其他办法吗?

最佳答案

似乎有一种方法可以在 api 调用上添加 noindex。

参见此处 https://webmasters.stackexchange.com/questions/24569/why-do-google-search-results-include-pages-disallowed-in-robots-txt/24571#24571

The solution recommended on both of those pages is to add a noindex meta tag to the pages you don't want indexed. (The X-Robots-Tag HTTP header should also work for non-HTML pages. I'm not sure if it works on redirects, though.) Paradoxically, this means that you have to allow Googlebot to crawl those pages (either by removing them from robots.txt entirely, or by adding a separate, more permissive set of rules for Googlebot), since otherwise it can't see the meta tag in the first place.

关于indexing - 防止搜索引擎索引我的 api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55463699/

相关文章:

python - 需要找到集合中不大于给定变量的最大数字

maven - Intellij IDEA 需要很长时间才能更新索引

MySQL优化: index choice WHERE vs JOIN

seo - 静态页面的301重定向

html - HipChat URL 图片预览

javascript - 如何更改“喜欢”/“发送”按钮在 Facebook 墙上发布的内容?

sql-server - INCLUDE 索引的命名标准?

localization - 在该国家/地区的 TLD 上使用特定于国家/地区的子域名是否有任何缺点(就 SEO 而言)?

url - 被谷歌丑化的美化网址

database - 优化 Wordpress 数据库设计