One tiny text file can decide whether Google sees your whole website or none of it. That file is robots.txt. A single wrong line can block your blog from crawling and nobody notices until traffic drops. Checking it takes a few minutes and it is one of the most useful habits in technical SEO.
This guide shows you exactly how to check a robots.txt file. You will learn five practical methods and how to read the rules inside the file. You will also see what the server responses mean and which mistakes cause the most damage. Everything here works for a small blog and a large online store alike. You can also test your rules anytime with our Robots.txt Checker or run a full Deep Website SEO Audit.
What Is a robots.txt File?
A robots.txt file is a plain text file that sits at the root of your website. It gives instructions to crawlers like Googlebot and Bingbot, following the Robots Exclusion Protocol (RFC 9309). The instructions say which parts of the site they may crawl and which parts they should skip.
Think of it as a polite sign on the front door. Well-behaved bots read the sign and follow it. The file does not lock anything and it does not protect private data. It is a request and not a security feature.
There is one more detail that trips people up. Robots.txt controls crawling and not indexing. A blocked page can still appear in search results if other sites link to it. Google just will not be able to read what is on it. If you want a page out of search results you need a noindex tag or a password. We will come back to this later.
Why You Should Check robots.txt Regularly
- Mistakes are costly. A leftover
Disallow: /from a staging site can wipe out visibility within days. - Plugins and developers change it. SEO plugins and CMS updates can rewrite the file without a warning.
- Crawl budget matters on big sites. Blocking low-value URLs like filters and internal search helps Google focus on pages that count.
- It explains strange Search Console messages. Statuses like “Blocked by robots.txt” and “Indexed, though blocked by robots.txt” start here.
5 Ways to Check robots.txt
You do not need all five every time. The browser check takes ten seconds and the others add detail when something looks wrong.
Method 1: Open It in Your Browser
This is the fastest way and it needs no tools. Type your domain into the address bar and add /robots.txt at the end.
https://www.yoursite.com/robots.txt
If the file exists you will see plain text. If you see a 404 page then the site has no robots.txt. That is allowed and it simply means crawlers can visit everything.
Pay attention to the exact address. A robots.txt file only applies to the protocol and host where it sits. The file on https://example.com does not cover https://blog.example.com and the http version is treated as its own origin. Each subdomain needs its own file.
To find the file that affects any page or image, cut everything after the host and add /robots.txt. For https://images.example.com/flowers/daffodil.png that gives https://images.example.com/robots.txt.
Method 2: Use the robots.txt Report in Google Search Console
Your browser shows you what is live right now. Google Search Console shows you what Google actually fetched. The two can differ and that gap often explains a problem.
Google replaced the old robots.txt Tester with a robots.txt report (documented in Google Search Central). Here is how to use it:
- Open Google Search Console and choose your property.
- Go to Settings and find the robots.txt report under Crawling.
- Look at the list of
robots.txtfiles Google found. - Click a file to see the last fetched version and any highlighted errors or warnings.
- Use Open live robots.txt to compare it with what Google has stored.
For each file the report shows a few useful details.
| Column | What It Tells You |
|---|---|
| File path | The full URL where Google looked for the file |
| Fetch status | Fetched, Not fetched (404) or Not fetched for another reason |
| Checked on | The last time Google tried to crawl the file |
| Size | The size of the fetched file in bytes |
| Issues | A count of parsing errors and warnings |
Key Details About the Search Console Report
- It is available for domain level properties and for host level URL-prefix properties. In a Domain property it shows files from up to 20 hosts.
- You can see earlier versions from the last 30 days. Click the file and then click Versions.
- Google ignores lines it cannot parse and follows the rest. An error means a rule was not used. A warning does not stop a rule from working.
- You can request a recrawl after you fix a serious problem. Google already recrawls
robots.txtoften so you rarely need this. Use it after an emergency fix or after you unblock important URLs.
Method 3: Test a Single URL with URL Inspection
Sometimes you do not care about the whole file. You just want to know whether one page is blocked. The URL Inspection tool answers that directly.
- Paste the full page URL into the search bar at the top of Search Console.
- Open the Page indexing section of the result.
- Check the Crawl allowed? line. It says Yes or “No: blocked by robots.txt”.
Use Test live URL if you recently changed the file and want a fresh answer. This is the closest thing to the old tester for checking individual pages. It reflects how Google really treats the URL and not how you think the rules read.
Method 4: Check from the Command Line
Developers like this one because it shows the response headers and the exact bytes returned. Open a terminal and run curl.
curl -i https://www.yoursite.com/robots.txt
The -i flag prints the headers first. Look at three things:
- The status code. You want
200. A404means no file and a5xxmeans the server is struggling. - The content type. It should be
text/plain. - Redirects. To see where a redirect leads add
-L. Long chains are a bad sign—verify them with a Redirect Chain Checker.
You can also test how a crawler is treated by changing the user agent:
curl -A "Googlebot" -i https://www.yoursite.com/robots.txt
This helps when a firewall or CDN serves a different answer to bots than to people. It is more common than you would think.
Method 5: Use a Validator or Crawler
Once a file gets long or you need to test hundreds of URLs you will want something stronger.
- SEO crawlers. Tools like Screaming Frog can read your
robots.txtand tell you which crawled URLs it blocks. This is great for auditing a whole site in one pass. - Online validators. Free robots.txt validators flag syntax errors and unsupported lines. Google also points people to a validator when the report shows parsing issues.
- Google’s open source parser. Developers can build Google’s robots.txt library and test files locally. It is the same code Google Search uses.
Whatever tool you pick remember that each one interprets edge cases slightly differently. For anything that really matters confirm the result in Search Console.
How to Read the Syntax
A robots.txt file is made of groups. Each group starts with a User-agent line and is followed by rules for that bot.
| Directive | Meaning | Example |
|---|---|---|
| User-agent | Names the bot the rules apply to | User-agent: Googlebot |
| Disallow | Blocks a path from crawling | Disallow: /cart/ |
| Allow | Makes an exception to a block | Allow: /cart/help.html |
| Sitemap | Gives the full URL of your sitemap | Sitemap: https://example.com/sitemap.xml |
Wildcards and Matching Rules
Two special characters make rules more flexible:
*matches any run of characters.Disallow: /*?sort=blocks every URL with a sort parameter.$marks the end of a URL.Disallow: /*.pdf$blocks URLs that end in.pdf.
A few more facts help you read a file correctly:
- Paths are case sensitive.
/Admin/and/admin/are different. - An empty
Disallow:line means nothing is blocked. - A lone
Disallow: /blocks the entire site for that bot. - Lines that start with
#are comments. - If a bot matches a specific group it follows that group only and ignores the
*group.
How to Test Whether a URL Is Blocked
When two rules seem to clash Google uses the most specific one. That means the rule with the longest matching path wins. If an Allow and a Disallow match equally well then Allow wins.
Here is a short example:
User-agent: *
Disallow: /blog/
Allow: /blog/seo-guide/
The page /blog/seo-guide/ is allowed because the Allow rule is longer and more specific. The page /blog/other-post/ is blocked because only the Disallow rule matches it.
What the Server Response Means
The file itself is only half the story. The way your server responds changes how Google behaves.
- 200. Google reads the file and follows the rules.
- 404. Google treats the site as having no restrictions. This is fine and many sites have no file at all.
- Redirects. Google follows a limited number of redirects. Keep it to one hop at most or none.
- 5xx errors. Treat these as urgent. Google may slow down or pause crawling until the file loads again.
Also keep the file under about 500 KB. Google only processes content up to that limit and ignores the rest. Use UTF-8 plain text and name it exactly robots.txt in lowercase.
Common robots.txt Problems to Look For
Here are the issues that cause real damage. Check for each one whenever you review the file.
- Blocking the whole site.
Disallow: /often survives from a staging environment or a “discourage search engines” setting. - Blocking CSS and JavaScript. Google needs these files to render pages. Blocking them can hurt how your content is understood.
- Using robots.txt to hide pages from search. It does not work reliably. Use
noindexor authentication. - Blocking a page that has a noindex tag. Google cannot see the tag if it is not allowed to crawl the page.
- Wrong location. A file in a subfolder is ignored. So is a file on the wrong subdomain.
- Typos and unsupported lines. A misspelled directive does nothing. Rules like
Crawl-delayare not used by Google. - Missing sitemap line. It is optional but it helps crawlers find your XML sitemap (verify yours with our XML Sitemap Finder).
- A different version on staging and live. Always check the live address.
robots.txt vs noindex: Do Not Mix Them Up
This is the most common confusion in the whole topic so it deserves its own section.
- robots.txt tells bots not to crawl a URL.
- noindex tells search engines not to show a page in results. It only works if the bot can crawl the page and see it.
If you want a page gone from Google do not block it in robots.txt first. Let Google crawl it so it can see the noindex tag. Block it later if you still want to. If a blocked page is already showing in results Search Console may report “Indexed, though blocked by robots.txt”. The fix is usually to remove the block and add noindex.
A Healthy Example File
This is a simple file for a WordPress site. Adjust the paths for your own setup, or build a custom one in seconds with our Robots.txt Generator.
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /?s=
Disallow: /search/
Sitemap: https://www.yoursite.com/sitemap.xml
It blocks the admin area and internal search pages. It still allows the one admin file that front-end features rely on. It also points to the sitemap. Nothing important is hidden.
A Quick robots.txt Check Routine
Run through this list once a month and after every site release, alongside your broader on-page SEO audit.
| Step | What to Check |
|---|---|
| 1 | Open /robots.txt in a browser on every host you use |
| 2 | Confirm the status is 200 and the file is plain text |
| 3 | Look for Disallow: / and other broad blocks |
| 4 | Make sure CSS, JavaScript and key pages are crawlable |
| 5 | Check the Search Console robots.txt report for errors |
| 6 | Run URL Inspection on your most important pages |
| 7 | Confirm the sitemap line is present and correct |
| 8 | Compare with the last version if something looks different |
How Often Should You Check?
Check after any launch or migration or plugin change. Do a routine review monthly for active sites. Many teams also set up an alert that tells them when the file changes. A short script that saves a copy and compares it daily is enough.
Conclusion
Checking robots.txt is quick and the payoff is big. Start with your browser to see the live file. Use the Search Console report to confirm what Google fetched. Then use URL Inspection to test the pages that matter most. Add curl or a robots.txt validator when you need more detail.
Make this a regular habit and a bad line will never sit unnoticed for weeks. Open your own robots.txt right now and read it from top to bottom. If every rule has a clear reason to exist you are in good shape.





