Should I remove meta-robots (index, follow) when I have a robots.txt?

后端 未结 2 1284
长发绾君心
长发绾君心 2020-12-11 14:04

I\'m a bit confused whether I should remove the robots meta tag, if I want search engines to follow my robots.txt rules.

If the robots meta-tag (index, follow) exist

相关标签:
2条回答
  • 2020-12-11 14:50

    With the robots.txt you can tell search engines not to crawl certain pages - but it wouldn't stop them from indexing the pages. If a page which is disallowed in the robots.txt is found by the crawler through an external link it can be indexed. That can be prevented through the meta-tag. Thus, the robots.txt and the meta-tag do work differently.

    https://developers.google.com/search/reference/robots_meta_tag?hl=en#combining-crawling-with-indexing--serving-directives

    Robots meta tags and X-Robots-Tag HTTP headers are discovered when a URL is crawled. If a page is disallowed from crawling through the robots.txt file, then any information about indexing or serving directives will not be found and will therefore be ignored. If indexing or serving directives must be followed, the URLs containing those directives cannot be disallowed from crawling.

    0 讨论(0)
  • 2020-12-11 14:52

    If a search engine’s bot honors your robots.txt, and you disallow crawling of /foo, then the bot will never crawl pages whose URL paths start with /foo. Hence the bot will never know that there are meta-robots elements.

    Conversely, this means that if you want to disallow indexing a page (by specyfing meta-robots with noindex), you should not disallow crawling of this page in your robots.txt. Otherwise the noindex is never accessed, and the bot thinks that crawling is forbidden, not indexing.

    0 讨论(0)
提交回复
热议问题