How to Check Robots.txt of a Website

Small business owner checking a robots.txt file on a laptop, with a printed SEO checklist on the desk.

Direct answer

Check robots.txt of a website by opening the file, reading what it says, and testing the URLs that matter. Open yoursite.com/robots.txt in a browser, check it answers 200, find the group Googlebot follows, and apply the longest matching rule to each key page. Then confirm in Search Console that Google fetched the file and your pages show Crawl allowed: Yes.

What are you actually checking?

A robots.txt file is a plain text file at the root of a host that tells crawlers which paths they may fetch, as groups of Allow and Disallow rules addressed to User-agent tokens, per mutqansoft.sa. RFC 9309 standardised it in 2022, per mutqansoft.sa. It controls crawling, not indexing, and obeying it is voluntary, per mutqansoft.sa.

A check answers three different questions, and each needs its own step. Mix them up and you will trust an answer to a question you never asked.

First, can Google fetch the file at all. A file that returns an error, redirects in a loop, or arrives as an HTML error page gives Google no rules to follow. Second, what does the file say: the list of groups and rules, and which group each crawler follows. Third, does it block anything that matters. A file can be perfectly valid and still hide your best pages from Google, because a single Disallow line can cover a whole section. Only a test of each key URL catches that.

Question What it answers Tool
Can Google fetch it Status, format and size of the file Browser, curl
What does it say Groups, rules and the Sitemap line Reading the file
Does it block anything Whether key URLs are allowed for Googlebot Hand test, URL Inspection

Step 1: Open the file and check the response

A robots.txt file applies only to the host, protocol and port where it is served, per 99visibility.com, quoting Google. The file on example.com does not cover shop.example.com, so test each host that serves pages: the bare domain, www, and any subdomain.

Type the address into a browser, for example https://www.example.com/robots.txt. A browser hides the status code, so check it with curl as well:

curl -sI https://www.example.com/robots.txt

The first line of the response is the status code, and the Content-Type line shows the format. A healthy file answers 200 with plain text in UTF-8, per visibilitymesh.com.

What robots.txt returns What Google does
200 with plain text Reads the rules
404, or any 4xx except 429 Crawls as if no robots.txt file existed, so nothing is blocked
5xx server error Stops crawling the site for 12 hours, then uses the last good copy for 30 days
200 with an HTML error page Finds no valid rules, since Google ignores lines it cannot parse

A server error on this file can pause crawling of the whole site, so fix it before anything else. The last row is the one to look hardest at: an HTML error page at robots.txt looks normal in a browser, and crawlers find no rules in it at all.

Two more details belong in the same check. Google follows at least five redirects for this file, and if it still has not reached the file it treats the file as a 404, per visibilitymesh.com. The file stays under 500 KiB, because Google ignores anything past that point, per visibilitymesh.com. Google generally caches the file for up to 24 hours, per visibilitymesh.com, so a fix you publish today may not reach Google until tomorrow.

Step 2: Read the groups and the rules

A group starts with one or more User-agent lines, and the Allow and Disallow rules under them belong to that group. Google follows the one group whose user agent matches the crawler most specifically, and it ignores every other group, per visibilitymesh.com. A crawler falls back to the star group only when no group names it, per visibilitymesh.com. Google states that user agent specific groups and global star groups are not combined, per 99visibility.com, quoting Google.

That last sentence is the trap most small sites fall into. When you give a crawler its own group, copy in every rule from the star group that should still apply to it, because a named group replaces the general one entirely.

Inside the group, the longest matching rule wins, not the first line. When an Allow and a Disallow rule are equally long, Google uses the less restrictive one, which is Allow, per visibilitymesh.com. Paths are case sensitive, so a rule for /Blog/ does not block /blog/. The star wildcard matches zero or more characters, and the dollar sign marks the end of the URL, per visibilitymesh.com.

Step 3: Test your key URLs by hand

Pick five to ten URLs that matter before you start: the home page, a product or service page, a page you meant to block, and the sitemap. For each one, find the group the crawler follows, then find every rule whose path matches the start of the URL path, and apply the longest one.

Work through this example file. It is an example file, not this site’s file, and it shows the named group trap in one place.

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /*?sort=
User-agent: Googlebot
Disallow: /tmp/
Crawler URL path Group Deciding rule Result
Googlebot /wp-admin/ Googlebot No matching rule Allowed
Googlebot /wp-admin/admin-ajax.php Googlebot No matching rule Allowed
Googlebot /?sort=price Googlebot No matching rule Allowed
Googlebot /tmp/report Googlebot Disallow: /tmp/ (5 characters) Disallowed
Googlebot /blog/post Googlebot No matching rule Allowed
Other crawler /wp-admin/ Star Disallow: /wp-admin/ (10 characters) Disallowed
Other crawler /wp-admin/admin-ajax.php Star Allow: /wp-admin/admin-ajax.php (24 characters) Allowed
Other crawler /?sort=price Star Disallow: /*?sort= (8 characters) Disallowed

Read the first three rows together. Googlebot has its own group, so the star group does not apply to it at all. The owner closed /wp-admin/ to everyone, then gave Googlebot its own group to block /tmp/, and that group replaced the star rules. A rule a named crawler must follow has to sit inside its own group.

Read the last three rows together. For a crawler with no own group, the star group applies, and the longest match decides. Allow: /wp-admin/admin-ajax.php is 24 characters, so it beats Disallow: /wp-admin/ at 10 characters. Disallow: /*?sort= is 8 characters, so /?sort=price is disallowed.

Step 4: Ask Google what it sees

The old robots.txt Tester is gone. On 15 November 2023 Google announced the Search Console robots.txt report and wrote that as part of the update it was sunsetting the robots.txt tester, per 99visibility.com. Three tools replace it.

First, the robots.txt report in Search Console Settings. It shows which robots.txt files Google found for the top 20 hosts on your site, the last time they were crawled, and any warnings or errors encountered, per 99visibility.com, quoting Google support. Check that the status says Fetched, the checked on date is recent, and the issues count is 0. The report only works on domain level properties, per serpsurfers.com.

Second, URL Inspection for a single page. You can test the availability of the URL with the URL inspection tool, per 99visibility.com, quoting Google. In the indexed result, the Crawl allowed field says Yes or No. Click Test live URL to check the page as it stands today.

Third, Google’s open source robots.txt library for a draft rule. Neither Search Console tool accepts a draft, so run a rule you have not published yet through the parser, or a third party tester, against the same URLs.

The report can say Fetched with zero issues while a valid, perfectly parsed rule blocks your best page. Only a per URL check catches that, per serpsurfers.com.

Step 5: Check the Sitemap line

A Sitemap line tells crawlers where your sitemap lives. Google wants a full address there, per visibilitymesh.com, and Sitemap lines must be absolute URLs, per mutqansoft.sa. Open it and confirm it answers 200 and lists your current pages.

A sitemap that lists pages your robots.txt blocks sends contradictory signals, and one of them is wrong. Confirm every URL it lists is allowed for Googlebot.

Worked example: this site’s own robots.txt

This site’s own live file shows what a healthy setup looks like. It was checked live on 4 Dec 2026 with a browser load and curl headers.

The file returns 200 with Content-Type text/plain, it is 173 bytes and 7 lines long, and its User-agent star group has an empty Disallow, which means nothing is blocked. It lists one Sitemap line pointing at the sitemap index. Its own response carries X-Robots-Tag: noindex, follow, which covers only the file itself.

Here are six posts, each tested against the file. Every one is allowed, because the empty Disallow matches nothing.

Live URL on this site Group Deciding rule Result Words in the slug Characters in the slug
/how-to-do-keyword-research-small-business-website-free/ Star Disallow: empty, no rule matches Allowed 9 words 54 characters
/how-to-use-long-tail-keywords-for-small-business-seo/ Star Disallow: empty, no rule matches Allowed 10 words 52 characters
/how-to-find-low-competition-keywords-for-a-small-business/ Star Disallow: empty, no rule matches Allowed 10 words 57 characters
/how-to-check-keyword-difficulty-for-free/ Star Disallow: empty, no rule matches Allowed 7 words 40 characters
/how-to-check-keyword-difficulty-in-bulk/ Star Disallow: empty, no rule matches Allowed 7 words 39 characters
/how-to-export-keywords-from-google-search-console/ Star Disallow: empty, no rule matches Allowed 8 words 49 characters

Two extra checks confirm the setup holds together. The sitemap index returns 200 and lists 5 sitemaps (post, page, category, post_tag, author), and all six posts above are listed in the post sitemap. The www and http versions of robots.txt both return a 301 redirect to the clean https non-www address.

A working robots.txt setup is boring on purpose. All six slugs are 39 to 57 characters, each page is allowed, and nothing was typed into a Disallow line for any of them. The check is worth doing anyway, because a single wrong line can hide every page from Google.

How to fix a robots.txt problem on WordPress

Find the source before you change anything, because the fix depends entirely on where the file comes from.

  • A rule you wrote in Yoast. WordPress serves a virtual robots.txt through its do_robots function, per visibilitymesh.com. In Yoast SEO you edit the file under Tools, then File editor, per visibilitymesh.com. Change the rule there, save, and re-check the live file.
  • A physical file on the server. Yoast documentation says WordPress generates the virtual file only when the site root holds no physical robots.txt file, per visibilitymesh.com. If a physical file exists, edit the file on the server instead.
  • The whole site blocked. Check the WordPress Settings, Reading checkbox first: since WordPress 5.3 the checkbox adds a noindex robots meta tag to the pages instead of changing robots.txt, per visibilitymesh.com. If the file itself carries Disallow: / under User-agent: star, that one line blocks the whole site.
  • A rule that blocks one section. Remove the rule, or narrow it to the exact path, then test the section’s URLs again.

After a fix, verify rather than assume. Reload the live file, run the hand test on your key URLs, and check one in URL Inspection. Google generally caches the file for up to 24 hours, per visibilitymesh.com, so an unchanged result the next morning is not evidence the fix failed.

How often should you check robots.txt?

A quarterly pass is enough for most small business sites, but check at the right moments.

  • After a launch: check the file once before you announce the site.
  • After a migration: check that the new origin serves its own file and that its Sitemap lines point to the new addresses.
  • After a plugin or theme change: check that the file still says what you meant it to say.
  • After a release: check one URL per template after each release.
  • After a Search Console warning: open the robots.txt report, then test the flagged URLs.
  • Every quarter: fold the robots.txt check into your regular audit. Our guide on how to do an SEO audit for a small business website shows the full routine.

Keep a short list of the URLs that must stay allowed, and of the paths that should stay blocked. When a test shows a result you do not recognise, check it against those lists first.

Common mistakes to avoid

Blocking a page and expecting it to vanish from Google. A disallowed URL can still be listed from links that point to it, just without its content, per mutqansoft.sa. If a blocked page still shows in Google, use noindex instead and leave the page crawlable, per visibilitymesh.com. Our guide on how to check if a page is noindex shows the noindex side of the same question. If the page that still appears is a duplicate, start with our guide on how to fix duplicate content on WordPress first.

Writing a noindex line inside robots.txt. Google does not support a noindex line in robots.txt, and it retired all code for that rule on 1 September 2019, per visibilitymesh.com. Put noindex in a robots meta tag, or send it in an X-Robots-Tag header, and either one works only if Google may crawl the page.

Giving a crawler its own group and forgetting the star rules. A named group replaces the general one entirely.

Trusting a clean report as proof no page is blocked. The report shows the file Google fetched and any parsing problems, but it cannot tell you whether a given page is blocked. Only a per URL check catches that, per serpsurfers.com.

Naming a private path in a Disallow line. Robots.txt is public, so a Disallow line that names a private admin path advertises it to anyone who reads the file, per mutqansoft.sa. Protect private areas with authentication, not with robots.txt.

Checking only the file and never the URLs. A file can parse cleanly and still block your best pages.

Frequently asked questions

How do I check the robots.txt file of a website?
Add /robots.txt to the root of the host, for example https://example.com/robots.txt, then open it and check the status code with curl, per 99visibility.com. Each subdomain and protocol has its own file.

Does Google Search Console still have a robots.txt tester?
No. Google sunset the tester in November 2023, when it launched the robots.txt report, per serpsurfers.com. The report shows the file Google fetched and any parsing problems, but it cannot test a URL or a draft.

How long does Google take to see a new robots.txt file?
Google generally caches robots.txt for up to 24 hours, so changes are usually picked up within a day, per serpsurfers.com. For an urgent fix, use Request a recrawl in the robots.txt report.

How do I check if one page is blocked by robots.txt?
Run the URL through URL Inspection and look at Crawl allowed, per serpsurfers.com. If it says No, a robots.txt rule is blocking Googlebot. Run Test live URL to check the current version after you changed the file.

What happens if my robots.txt file returns a 404 or a server error?
A 404, or any 4xx status other than 429, makes Google crawl as if the site had no robots.txt file, per visibilitymesh.com. A 5xx server error makes Google stop crawling the site for 12 hours while it keeps asking for the file, per visibilitymesh.com.

Which rule wins when Allow and Disallow both match a URL?
The rule with the longer path wins, since Google treats it as the more specific one, per visibilitymesh.com. When both rules have the same length, Google applies the less restrictive rule, which is Allow. The rules only compete inside the group the crawler follows.

Conclusion

Checking robots.txt is three small checks: confirm Google can fetch the file, read the groups and rules it carries, and test the URLs that matter. When the file answers 200, the rules are clean, and every key page is allowed, the site is set. When a rule blocks something it should not, fix the rule and test the URLs again.