What is a robots.txt file?

It is a text file at https://example.com/robots.txt with rules for crawlers.

User-agent: *
Disallow: /admin/
Sitemap: https://example.com/sitemap.xml
Test result of the rules above

Googlebot /admin/settings Blocked
Googlebot /blog/ Allowed

Blocking a page in robots.txt does not hide it from search, and it does not protect private data. See Robots.txt.


Learn more about the similar topics:
Tutorials
SEO – Canonical URLs
SEO – Robots.txt
SEO – XML Sitemap
Exercises & Assignments
Write a robots.txt file to block folders
Block all PDF files and URLs with a parameter in robots.txt
Add a canonical tag to a filtered page
Create an XML sitemap for three pages
Interview Questions & Answers
Which is more useful between an HTML sitemap and an XML sitemap?
What is technical SEO?
What is a robots.txt file?
What is an XML sitemap?
What is a canonical tag?
What is crawl budget?
What is duplicate content and how do you fix it?