A robots txt file is a plain text file at the root of your website that tells crawlers which URLs they may request. It is small, easy to edit and easy to get wrong, because one short line can close off an entire site.
This guide explains what the file controls, what it cannot do, how to write it, how to test it and which mistakes to catch before they cost you visits.

What Is Robots Txt Used For?
The file manages crawling, which means the requests bots make to your pages and files. Google's introduction to robots.txt describes it mainly as a way to avoid overloading a site with requests.
- It can keep crawlers out of areas with no search value, such as cart steps or internal search results.
- It can reduce repeat crawling of duplicate or unimportant URLs.
- It can manage crawl traffic for images, video and audio files.
- It can point crawlers to your XML sitemap.
Does It Matter for Crawl Budget?
That term is the common name for how much crawling a search engine spends on your site. Blocking useless URLs can steer bots away from them, but it is not a ranking switch.
- Large stores with many filter and sort URLs have the most reason to review it.
- A small brochure site should first check that its key pages are linked and indexable.
- Never block a page you want found just to save requests.
What Can Robots.txt Not Do?
It cannot hide a page or keep it out of Google for certain. Google says a blocked URL can still be indexed if other pages link to it, and the result then usually appears without a description.
- It is not a security lock, since crawlers choose whether to obey it.
- Anyone can open the file, so listing a secret folder only advertises it.
- A crawler that cannot fetch a page cannot read a noindex tag placed inside it.
- It does not remove other websites' links to your pages or files.
Which Control Matches Your Goal?
Start from the result you want, then choose the tool. The robots.txt file is only one of them.
- To stop bots requesting a folder, use a Disallow rule.
- To keep a page out of search, use noindex and leave the page crawlable.
- To keep content private, use password protection.
- To help bots find pages, use a sitemap and internal links.
Where Should the File Live and How Should You Save It?
The name must be exactly robots.txt and it must sit at the root of the host it governs. Google's guide to creating a robots.txt file sets out these basics.
- Place it at yourdomain.com/robots.txt, never inside a subfolder.
- Give each subdomain its own file, because rules do not carry across hosts.
- Treat the http and https versions as separate addresses too.
- Write it in a plain text editor and save it as UTF-8.
- Avoid word processors, which can insert curly quotes that break rules.
How Do You Write the Rules?
The file is made of groups. Each group starts by naming a crawler and then lists the paths that crawler may or may not request. Lines are read as instructions, so keep one rule on each line.
| Line | What it does | Watch for |
|---|---|---|
| User-agent | Names the crawler | An asterisk means general bots |
| Disallow | Blocks a path | Start with a slash |
| Allow | Opens a path inside a block | Use for exceptions |
| Sitemap | Gives the sitemap address | Use the full URL |
| # | Adds a comment | Crawlers ignore it |
How Does a Crawler Choose Which Group to Follow?
A crawler follows one group, the one that matches its name most specifically. It does not add the general rules on top of its own group.
- Anything you have not disallowed is open to crawling by default.
- Paths are case sensitive, so /Offers/ and /offers/ are different.
- The asterisk can stand in for part of a path.
- Google's AdsBot crawlers ignore the general asterisk group and must be named.

What Does a Safe Robots Txt Example Look Like?
Start short. The sample below is an illustration for an imaginary small shop, so change every path to match folders that really exist on your site.
User-agent: *
Disallow: /cart/
Disallow: /search/
Allow: /search/help/
Sitemap: https://example.com/sitemap.xml
- The first line applies the group to general crawlers.
- The cart and internal search folders are closed to crawling.
- The help page folder inside search stays open as an exception.
- The last line tells crawlers where the sitemap is.
To block one crawler from everything, give it its own group with its name and a single slash after Disallow. Be very careful: the same slash under the asterisk closes your site to general crawlers.
What Should WordPress Site Owners Check?
A robots txt WordPress review should begin in the browser, not in the dashboard. What loads at your /robots.txt address is what crawlers receive, whether it comes from an uploaded file, a plugin or your host.
- Open the live address and copy the current rules somewhere safe.
- Find where those rules are edited before changing anything.
- Keep stylesheets and scripts that pages need for display open to crawlers.
- If you block the admin folder, check that front-end features still work.
- Reload the live file after saving, and clear any site cache.
Hosted builders may not let you edit the file at all and may offer a search visibility setting instead. If you are planning a rebuild, ask your web development company in Chennai who owns this file at launch, so a staging block does not travel to the live site.
Should You Let a Tool Write the File?
A robots txt generator can type the syntax for you, but it cannot know which parts of your business site matter. Treat its output as a first draft and read every line before uploading.
- List the folders you want blocked, with a reason for each.
- Remove any rule you cannot explain in one sentence.
- Check that no service, product, category or blog path is caught.
- Confirm the sitemap address opens in a browser.
How Do You Test the File Before and After Publishing?
Testing has two parts: can crawlers reach the file, and do the rules mean what you intended. Google names a Search Console report and its open-source parser library, which is the closest thing to an official robots txt tester.
- Open the file in a private browser window to confirm it is public.
- Read the robots.txt report in Search Console for the live file.
- Ask a developer to try draft rules locally with Google's library.
- Check a few important URLs and a few blocked URLs against the rules.
- Note the date and the change, so you can reverse it.
If you have not set up the tool yet, follow our Google Search Console guide for beginners first.
Which AI Crawlers Can You Control?
OpenAI publishes separate names for separate jobs, so you can decide about each one. Its crawler documentation is the place to confirm current names before editing.
- OAI-SearchBot is used to surface sites in ChatGPT search features.
- GPTBot collects content that may be used to train OpenAI's models.
- ChatGPT-User acts on a user's request, so robots.txt rules may not apply to it.
- Blocking GPTBot and blocking OAI-SearchBot are independent choices.
- OpenAI says search changes can take about 24 hours to take effect.
Other AI companies use their own names, so check each company's official page rather than copying a list from a blog.

What Did We Learn From Reading Our Own File?
You can open ushermedia.in/robots.txt and follow along. It has a general group that blocks one script folder, separate groups that allow named AI crawlers such as GPTBot and OAI-SearchBot, and a sitemap line.
- A named group stands alone, so the general folder block is not repeated inside those AI groups.
- If a block should apply to a named crawler, write it inside that crawler's group.
- A readable file makes this kind of gap easy to spot.
In practice, a rule can be valid and still not apply where a reader expects. That is why we treat the file as part of technical review and not a one-time setup. Usher's Report Zero process includes a website and technical SEO audit that looks at structure and technical issues affecting rankings.
Which Mistakes Should You Catch?
Most damage comes from a rule that is broader than its author intended. Compare your file with this table after every redesign, migration or plugin change.
| Mistake | Fix |
|---|---|
| Whole site disallowed after launch | Remove the lone slash rule |
| Blocking to remove from Google | Use noindex and allow crawling |
| Needed CSS or scripts blocked | Open those files |
| File placed in a subfolder | Move it to the root |
| Wrong letter case in a path | Match the real URL |
| Private folder named in the file | Protect it with a password |
The file is one item in a wider health check. Work through our technical SEO checklist for websites for the rest, or ask an SEO company in Chennai to review crawling and indexing together.
Frequently asked questions
Does every website need a robots.txt file?
No site is obliged to block anything, and anything not disallowed can be crawled by default. A short file with a sitemap line is still useful, because it shows clearly what you intend and gives your team one place to review crawl rules.
Will a Disallow rule remove a page that already shows on Google?
Not reliably. A blocked URL can remain indexed, particularly when other pages link to it. Add a noindex tag or header and leave the page crawlable so the instruction can be read. For private material, protect it with a password or remove it.
Can robots.txt stop every bot from visiting my site?
No. Reputable crawlers follow the rules, while others may ignore them. If a bot is causing load or misuse, talk to your host or developer about server or firewall controls instead of relying on this text file.
Do I need a separate file for my blog subdomain?
Yes, if the blog sits on its own subdomain and you want rules there. A file applies only to the protocol, host and port where it is posted. A blog kept in a folder of your main domain uses the main file.
Should a small business block AI crawlers?
It depends on what you want. Blocking a training crawler and blocking a search crawler have different effects. If you would like your pages to appear in AI search answers, read each company's own documentation before you disallow any of its crawler names.
How often should the file be reviewed?
Review it whenever the site changes in a way that touches addresses, such as a redesign, a migration, a new shop section or a new SEO plugin. A quick look at the live file after each release can catch a staging block early.
Ask Usher Media for a Report Zero audit. We check your website structure, speed, mobile performance and the technical issues that affect rankings, then give you a clear action plan.
Book a Technical SEO Check →