Blog

Robots.txt: what it is, what it looks like and how to check yours

Robots.txt is a text file at yourbusiness.com/robots.txt that tells search engine and AI assistant crawlers which parts of your website they may visit. A single wrong line can block the whole site, so it is worth checking once.

Zmienka team · · 7 min read

Robots.txt is a plain text file in the root of your website that tells search engine and AI assistant crawlers which parts of the site they may visit and which they should stay out of. It is not a way to hide a page from Google; for that you need a noindex rule or a password. If a wrong line is left in it, it can shut crawlers out of the entire site, so open yours and check it once. For a quick look at how it treats AI crawlers, use our free robots.txt checker for AI.

What robots.txt does and what it does not do

Robots.txt controls where crawlers may go, not what appears in search results. A crawler is a program that visits websites automatically and reads their content, such as Googlebot for Google Search. Google's introduction to robots.txt says the file is used mainly to manage crawler traffic so that requests do not overload your site.

What it does not do matters just as much. The same page states that robots.txt is not a mechanism for keeping a web page out of Google. If other websites link to a blocked address, Google can still show that address in search results, only without a description. To keep a page out of results, Google recommends a noindex rule or password protection.

Robots.txt is also only a request. Google points out that the rules cannot enforce what a crawler does. Googlebot and other well behaved crawlers follow them, but some crawlers may not. That makes the file useless for protecting private information, especially since anyone can open it in a browser.

What a robots.txt file looks like

A robots.txt file is made of groups of rules, and each group starts with a User-agent line that says which crawler it applies to. An asterisk means all crawlers. Below it come Disallow and Allow lines with paths on your site, and optionally the address of your sitemap.

LineWhat it meansExample
User-agentWhich crawler the group applies toUser-agent: * (all crawlers)
DisallowA path the crawler should not visitDisallow: /admin/
AllowAn exception to a Disallow ruleAllow: /admin/public/
SitemapThe full address of your sitemapSitemap: https://yourbusiness.com/sitemap.xml

A small business website with nothing to hide, such as the site of a hair salon or a garage, only needs a short file. This is a sensible starting point that allows everything and shows where the sitemap is:

User-agent: *
Allow: /

Sitemap: https://yourbusiness.com/sitemap.xml

Google's robots.txt specification sets a few rules worth knowing. The file must sit in the top level directory of the site, and its rules apply only to the host, protocol and port where it is hosted, so a subdomain needs its own file. Google reads at most 500 KiB and ignores anything after that. Paths in the rules are case sensitive, so /Admin/ and /admin/ are two different paths. The Sitemap line must contain a full address, including https and the domain. If you are not sure what a sitemap is or where yours lives, our guide on how to find and submit your XML sitemap explains it.

Robots.txt and AI assistant crawlers

You can also use robots.txt to allow or block the crawlers that collect content for AI assistants, and each of them has a different job. If you want an assistant to be able to find your website when a customer asks a question, do not block the crawler it uses for search.

OpenAI's page about its crawlers describes three of them:

  • OAI-SearchBot is used to show websites in ChatGPT's search features. According to OpenAI, sites that block it will not be shown in ChatGPT search answers, though they can still appear as navigational links.
  • GPTBot collects content that may be used to train OpenAI's models. Blocking it signals that your content should not be used for training.
  • ChatGPT-User visits pages when a user asks ChatGPT to do something. It does not crawl the web automatically, and OpenAI says that because these visits are started by a user, robots.txt rules may not apply.

Google has a similar control called Google-Extended. Google's list of common crawlers explains that it is not a separate crawler, only a name you use as the User-agent in robots.txt. It does not affect whether your site is included in Google Search and is not a ranking signal. It does decide whether your content may be used to train future Gemini models and to ground answers in Gemini Apps. A different file, llms.txt, does not allow or block anything; our article on what llms.txt is and whether a small business needs one explains the difference.

Access to your website matters for AI answers. In the Zmienka measurement of 30 October 2026, which used Gemini 3.8 Flash with Google Search through the API and covered 216 answers to questions about local businesses in Slovakia, the model searched the web first in 190 answers and answered without searching in only 26. The details are in our study of AI recommendations.

How to check your robots.txt in five minutes

The quickest check is to open yourbusiness.com/robots.txt in your browser and read what it says. If you get a 404 error, the file does not exist, and according to Google's specification that is treated as if there were no crawl restrictions.

  1. Open yourbusiness.com/robots.txt in a private browser window.
  2. Look for the line Disallow: / under User-agent: * or under the name of a specific crawler. That line blocks the whole site for that crawler.
  3. Look for the names of AI crawlers (OAI-SearchBot, GPTBot, Google-Extended) and check whether any block on them is one you know about.
  4. Check that the Sitemap line holds a full address that actually opens.
  5. If you use Search Console, open the robots.txt report in the property settings. According to the Search Console Help page on the report, it shows the fetch status, when Google last checked the file, its size and any issues it found.

If you have not set up Search Console yet, our Google Search Console guide walks you through it. You can also run the free website check, which reads your robots.txt and sitemap and tells you what to fix for each item.

Robots.txt mistakes common on small business websites

The most common robots.txt mistake is a block on the whole site that was left over from when the site was being built. Developers often hide a new site from search engines while they work on it, and if the Disallow: / line is not removed at launch, the block stays in place.

  • Blocking the whole site. The line Disallow: / under User-agent: * shuts out every crawler that follows the rules.
  • Blocking a page and adding noindex to it. Google's guide to noindex says the rule only works if the page is not blocked by robots.txt, because Google has to crawl the page to see it. A page you want removed from results must stay open to crawlers.
  • Wrong capital letters. Paths are case sensitive, so a block on /Cart/ does not apply to /cart/. Check the rules again whenever page addresses on your site change.
  • Server outages. According to Google's specification, if the file returns a server error (a 5xx code), Google stops crawling the site for the first 12 hours and then uses the last good copy of the file for up to 30 days.
  • A block on AI crawlers you did not know about. If you find OAI-SearchBot or Google-Extended blocked, find out who added the rule and why. Whether to let them in is your decision, but it should be a decision you know you made.

If your website does not show up on Google at all, robots.txt is only one possible cause. Our article on why your website is not showing on Google covers the others.

What to do with your robots.txt today

For a small business website, the best robots.txt is short, free of unnecessary blocks and includes the address of your sitemap. Open yours today, and if you find Disallow: / or a block on a crawler you did not know about, send whoever manages your site the exact line that needs to change.

After the fix, give Google some time. Its specification says it generally caches the file for up to 24 hours, and in the Search Console robots.txt report you can choose Request a recrawl next to the file. Robots.txt is one of the technical basics that also matter for generative engine optimization. If you want to know whether AI assistants name your business when customers ask, check it with the AI visibility test, which shows each result with the date and the engine it came from.

Frequently asked questions

Does every website need a robots.txt file?

No. According to Google's documentation, a 404 error for robots.txt is treated as if the file did not exist, and Google then crawls the site without restrictions. The file is useful when you want to keep crawlers out of some parts of the site or list the address of your sitemap.

How do I edit robots.txt in WordPress or another website platform?

It depends on the platform and the plugins your site uses. Google notes that on hosted platforms such as Wix or Blogger you may not be able to edit the file directly and should look for a search settings page instead. Elsewhere it is uploaded through FTP or your hosting control panel. If someone else manages your site, send them the exact text you want in the file.

How long does a change to robots.txt take to work?

Google says it generally caches the contents of robots.txt for up to 24 hours. OpenAI says that for OAI-SearchBot it can take about 24 hours from a robots.txt update for its systems to adjust.

Can I use robots.txt to hide a page with passwords or partner prices?

No, robots.txt is not protection. Anyone can open the file and read it, and crawlers do not have to follow it. Protect sensitive pages with a password.

Check your website for free

Enter your address and in a few seconds you will see what is fine on your website and what to fix. No sign-up.