A robots.txt file tells crawlers which parts of your site they may fetch. Google’s guide to creating a robots.txt file sets out the rules. Remember that robots.txt is about crawling, not hiding pages from Search; see the introduction to robots.txt.
Quick facts
- Name: exactly `robots.txt`; one file per site
- Location: the root of the host, such as `https://www.example.com/robots.txt`
- Format: UTF-8 plain text, saved in a plain text editor
- Scope: rules apply only to the exact protocol, host and port where the file is posted
- Last checked: 18 November 2026 against Google Search Central
The rules for the file
- The file must be named exactly `robots.txt` and a site can have only one
- It must sit at the root; it cannot go in a subdirectory
- Subdomains and non-standard ports can each have their own file
- Use a plain text editor, not a word processor
The syntax
A file holds one or more groups. Each group starts with a `User-agent` line and has one rule per line.
| Line | Meaning |
|---|---|
| `User-agent` | Required. `*` matches all crawlers except AdsBot, which must be named |
| `Disallow` | A path the agent should not crawl; it starts with `/` |
| `Allow` | Overrides a Disallow for a page or folder inside a disallowed directory |
| `Sitemap` | Optional; a fully qualified URL; allowed more than once |
Rules are case-sensitive, `#` starts a comment and anything not disallowed is allowed. All rules except `Sitemap` support the `*` wildcard.
A small example
“`
User-agent: *
Disallow: /private/
Sitemap: https://example.com/sitemap.xml
“`
Upload and test
There is no single upload tool; the method depends on your hosting. Open the file URL in a private browsing window to check that it is public. The robots.txt report in Search Console works for files already live. Google’s crawlers find and use the file once it is uploaded. See our guides to robots meta tag rules and how to check if a page is indexed.
Our own check: robots.txt on three sites
On 18 November 2026 we requested the robots.txt file of the three sites we run, over http, https and the www host, using curl from one computer. This is a small check of how real files behave against the rules above, not a study.
| Site | Served at | Content type | http and www versions |
|---|---|---|---|
| extremeseotips.com | https://extremeseotips.com/robots.txt, status 200 | text/plain; charset=utf-8 | Both redirect once to the https non-www file |
| startupindiatoday.com | Same pattern, status 200 | text/plain; charset=utf-8 | Both redirect once to the https non-www file |
| carrunningcostcalculator.com | Same pattern, status 200 | text/plain (no charset stated) | Both redirect once to the https non-www file |
What it shows: each site has one file at the root of its host, served as plain text, and each includes a fully qualified Sitemap line. The files differ in style: one blocks only /wp-admin/ with an Allow for admin-ajax.php, one is an empty Disallow (everything allowed), one also blocks two folders. Because the http and www addresses redirect, a crawler that starts there ends up at the same single file.
Limits: three sites, one computer, one day. We did not test how Google reads each rule, and we did not use the Search Console robots.txt report for this post.
What we checked
| Source | Publisher | Read on | Supports |
|---|---|---|---|
| How to write and submit a robots.txt file | Google Search Central | 18 Nov 2026 | File name, one file per site, root location, UTF-8, scope of protocol, host and port, groups, user-agent, allow, disallow, sitemap, case sensitivity, wildcards, upload and test steps |
| Our own curl check of three robots.txt files | Own test | 18 Nov 2026 | Status, content type and redirects shown above |
Not checked: Google’s separate page on how it interprets the robots.txt specification (size limits, precedence between rules), and how other search engines handle these rules.
Frequently asked questions
Does robots.txt remove a page from Google?
No. Google says it is not a mechanism for keeping a page out of Google. Use noindex or password protection.
Where must the file go?
At the root of the host it applies to.
What if my platform will not let me edit it?
Google says hosted site builders may not allow direct editing and may offer a search settings page instead.
Written by Bala A. Last checked 18 November 2026. Spotted an error? Contact us at https://extremeseotips.com/contact/ and we will check it and correct the post.



