佛性SEO

 找回密码
立即注册
查看: 496|回复: 0

The ultimate guide to robots.txt

[复制链接]

78

主题

78

帖子

20

积分

积分
20
发表于 2023-11-2 09:27:30 | 显示全部楼层 |阅读模式
The robots.txt file is one of the main ways of telling a search engine where it can and can't go on your website. All major search engines support its basic functionality, but some respond to additional rules, which can be helpful too. This guide covers all the ways to use robots.txt on your website.
Warning!

Any mistakes you make in your robots.txt can seriously harm your site, so read and understand this article before diving in.
Table of contents



Whatisa robots.txt file?
What does the robots.txt filedo?
Where should I put my robots.txt file?
Pros and cons of using robots.txt
Robots.txt syntax
Don't block CSS and JS files in robots.txt
Test and fix in Google Search Console
Validate your robots.txt
See the code


Whatisa robots.txt file?

Crawl directivesThe robots.txt file is one of a number of crawl directives. We have guides on all of them and you'll find them here.

A robots.txt file is a plain text document located in a website's root directory, serving as a set of instructions to search engine bots. Also called the Robots Exclusion Protocol, the robots.txt file results from a consensus among early search engine developers. It's not an official standard set by any standards organization, although all major search engines adhere to it.
Robots.txt specifies which pages or sections should be crawled and indexed and which should be ignored. This file helps website owners control the behavior of search engine crawlers, allowing them to manage access, limit indexing to specific areas, and regulate crawling rate. While it's a public document, compliance with its directives is voluntary, but it is a powerful tool for guiding search engine bots and influencing the indexing process.
A basic robots.txt file might look something like this:
User-Agent: *
Disallow:

Sitemap: https://www.example.com/sitemap_index.xml
What does the robots.txt filedo?

CachingSearch engines typically cache the contents of the robots.txt so that they don't need to keep downloading it, but will usually refresh it several times a day. That means that changes to instructions are typically reflected fairly quickly.

Search engines discover and index the web by crawling pages. As they crawl, they discover and follow links. This takes them from site A to site B to site C, and so on. But before a search engine visits anypage on a domain it hasn't encountered, it will open that domain's robots.txt file. That lets them know which URLs on that site they're allowed to visit (and which ones they're not).
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

  • 外链吧 | 雨住水巷 | 五金修配网 | 免费优化 | 全能百科 | 万能社区 | 链接购买
  • 在线咨询

  • 外链吧正规seo交流2群

    QQ|手机版|小黑屋|佛性SEO |网站地图|网站地图

    GMT+8, 2024-10-22 22:48 , Processed in 0.081873 second(s), 23 queries .

    快速回复 返回顶部 返回列表