Robots.txt is a text file which contains few lines of simple code.
It is saved on the website or blog's server which instruct the web crawlers on how to index and crawl your blog in the search results.
That means you can restrict any web page on your blog from web crawlers so that it can't get indexed in search engines like your blog labels page, your demo page or any other pages that are not as important to get indexed.
Always remember that search crawlers scan the robots.txt file before crawling any web page.
This code is divided into three sections. Let's first study each of them after that we will learn how to add custom robots.txt file in blogspot blogs.
This code is for Google Adsense robots which help them to serve better ads on your blog. Either you are using Google Adsense on your blog or not simply leave it as it is.
This is for all robots marked with asterisk (*). In default settings our blog's labels links are restricted to indexed by search crawlers that means the web crawlers will not index our labels page links because of below code.
That means the links having keyword search just after the domain name will be ignored. See below example which is a link of label page named SEO.
This code refers to the sitemap of our blog. By adding sitemap link here we are simply optimizing our blog's crawling rate.
Means whenever the web crawlers scan our robots.txt file they will find a path to our sitemap where all the links of our published posts present.
Web crawlers will find it easy to crawl all of our posts.
Hence, there are better chances that web crawlers crawl all of our blog posts without ignoring a single one.
Note: This sitemap will only tell the web crawlers about the recent 25 posts. If you want to increase the number of link in your sitemap then replace default sitemap with below one. It will work for first 500 recent posts.