

Robots.txt Best Practices for Small Business Websites
A robots.txt file is a small text file that tells search engine crawlers which parts of your site they may request. Done right, it keeps crawlers on your important pages. Done wrong, it can hide your whole site from Google, and it will never protect private data. We build and secure websites for small businesses, and this file is one of the few places where a single line can quietly cost you your rankings.
Table of Contents
TL;DR
- Put one file named robots.txt at the root of each host, saved as UTF-8 text, with user-agent groups, Allow/Disallow rules and a Sitemap line.
- Use Disallow to manage crawling. Use noindex to keep a page out of search results, and never block a page you have marked noindex.
- Do not block CSS or JavaScript files, and never list private paths in the file. It is public.
- Robots.txt is not security. Patient, client or financial data needs real access controls.
- Test the file after every change and re-check it when you redesign or migrate.
Table of Contents
- What robots.txt does, and what it cannot do
- Where the file goes and how it is formatted
- Robots.txt examples you can adapt
- Disallow vs. noindex
- Best practices checklist
- Robots.txt and sensitive or HIPAA-regulated data
- How to test and troubleshoot your file
- Perspective
- Getting it right without guesswork
- FAQ
- Sources
What robots.txt does, and what it cannot do
Robots.txt tells crawlers which URLs they can access. Google describes it as a way to manage crawler traffic, not a way to keep a page out of Google. A disallowed URL can still show up in results, without a description, if other sites link to it.
Two more limits matter:
- It is a request, not enforcement. Reputable crawlers follow it. Digital.gov notes the instructions are guidance, not binding requirements.
- It is public. Anyone can open yoursite.com/robots.txt. MDN’s security guidance warns that listing sensitive paths there reveals their location to attackers, and that malware bots and email harvesters ignore the file.
For a small business, the file has two jobs: keep crawlers from wasting time on low-value URLs, and point them to your sitemap.
Where the file goes and how it is formatted
Google’s instructions for creating a robots.txt file set the basics:
- Name it exactly robots.txt.
- Place it at the root of the host, such as https://www.example.com/robots.txt. A subdirectory does not work.
- Save it as UTF-8 text.
- Remember it applies only to the protocol, host and port where it sits. A subdomain such as shop.example.com needs its own file, as Digital.gov also advises.
Inside, rules are grouped by user-agent, the name a crawler uses to identify itself. Each group has Allow and Disallow lines. Put each directive on its own line.
Google supports four fields: user-agent, allow, disallow and sitemap. Fields such as crawl-delay are not supported by Google, so do not rely on them to slow it down.
Robots.txt examples you can adapt
Google’s own documentation shows a simple pattern: one group for a specific crawler, one general group, and a sitemap line. Here is a typical small-business version:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /search/
Disallow: /cart/
Sitemap: https://www.example.com/sitemap.xml
What each part does:
User-agent: *applies the group to all crawlers.- The Disallow lines keep crawlers out of admin screens, internal search results and cart pages, which add no value in search.
- The Allow line makes an exception for one file the site needs.
- The Sitemap line gives the full URL of your XML sitemap.
To allow everything, use an empty Disallow:. To block everything, use Disallow: /. That second line is the one that destroys rankings when it survives a launch.
Internal search pages
In July 2026, PPC Land reported that Google’s John Mueller said Google no longer lists internal search results as something publishers must block, while still recommending it for technical reasons. He advised one wide rule rather than listing every query pattern. For most sites, a single Disallow: /search/ style rule does the job.
Use broad patterns
Chrome’s Lighthouse documentation recommends broad patterns such as disallow: /*.pdf over long lists of individual URLs. It also warns that search engines may stop reading a file larger than 500 KiB, and lists common errors: missing user-agent values, patterns that do not start with / or *, and a $ used mid-pattern.
Disallow vs. noindex
This is where most small sites go wrong. The two do different things.
| Goal | Use | Why |
|---|---|---|
| Keep crawlers from fetching a section | Disallow in robots.txt | Saves crawl effort on low-value URLs |
| Keep a page out of search results | noindex meta tag or X-Robots-Tag header | Google says this is the supported method |
| Keep information private | Password or login | Neither of the above secures anything |
The trap: for noindex to work, the page must be crawlable. If robots.txt blocks it, Googlebot never sees the noindex rule, and the page can still appear if other pages link to it. Google’s documentation also says noindex inside robots.txt is not supported.
Google’s Martin Splitt made the same point, as reported by Search Engine Journal: use noindex when a page may be crawled but should stay out of results, such as a thank-you page, and do not combine both on one page.
The valid robots meta tag rules include all, noindex, nofollow and none, and crawlers can read them only if they are allowed to reach the page.
Best practices checklist
- Keep important pages crawlable. Services, locations, blog posts and contact pages must never sit under a Disallow rule.
- Do not block CSS or JavaScript. Yoast explains that blocking them stops Google from checking whether your site works as intended, which can hurt rankings.
- Add your sitemap. One Sitemap line helps crawlers find your pages.
- Block low-value URL spaces. Internal search, cart and checkout, filtered or faceted URLs, and admin areas.
- Do not use it for secrets. Never list a folder of client files or patient documents.
- Keep it short and readable. Add comments with # so the next person knows why a rule exists.
- Review it after every redesign, migration or platform change. Staging rules often leak into production.
For the on-page side of visibility, our on-page SEO checklist pairs well with this file, and our guide on building a site for AI search covers how newer crawlers read your content.
Robots.txt and sensitive or HIPAA-regulated data
If you run a medical, dental, legal or accounting practice, treat this file as a visibility tool only. It is public, so a line like Disallow: /patient-forms/ tells everyone exactly where to look. MDN advises using robots.txt only to reduce load and keep unsuitable content out of search results, never to prevent disclosure of private information.

Protected data belongs behind authentication, encryption and access controls. That is a security and compliance job, and it is part of what we do for healthcare providers and CPA firms through our cybersecurity services and HIPAA compliance work.
How to test and troubleshoot your file
- Open it in a private window. Go to yoursite.com/robots.txt and confirm it loads, as Google recommends.
- Test the markup with the robots.txt report in Search Console or Google’s open-source parser.
- Wait or request a recrawl. Google’s crawlers refresh their cached copy every 24 hours, and the Request a recrawl function in the report speeds it up.
- Watch indexed page counts. Google’s Page indexing report help says a drop in indexed pages without matching errors often means pages are blocked by robots.txt, noindex or a login. Inspect example URLs and test the live version.
If pages vanish after a launch, check for a leftover Disallow: / first.
Perspective
Most robots.txt disasters we see in the abstract are not clever mistakes. They are a staging setting that went live, a plugin that rewrote the file, or a well-meant attempt to hide something that should have been locked down.
Our view is that this file should be reviewed as part of the website itself, alongside the sitemap, the meta tags, hosting and security. Visibility and security are one job. A rule that helps Google find your service pages and a rule that keeps a private folder private are different tools, and mixing them up is how businesses end up invisible or exposed.
If you run a business, put the file on a recurring review schedule, and treat anything sensitive as a security matter, not an SEO one.
Randy Bryan
Getting it right without guesswork
If your site is on a new build, a platform change or a redesign, the robots.txt file, sitemap and indexing rules should be checked together. Our search engine optimization team handles technical SEO for small and mid-sized businesses, and our website development and maintenance services cover the site itself, so crawl rules and security are set up with the rest of the build.
FAQ
Does every website need a robots.txt file?
No, but nearly every business site benefits from one. Without it, crawlers assume everything is allowed. A small file lets you steer them away from admin and search pages and point to your sitemap.
Can robots.txt remove a page from Google?
No. A disallowed URL can still appear in results if other sites link to it. Use a noindex meta tag or X-Robots-Tag header, and leave the page crawlable so Google can see it.
Is noindex supported in robots.txt?
No. Google does not support a noindex rule inside robots.txt. Put it in the page’s meta tag or HTTP header instead.
How long until Google sees my changes?
Google’s crawlers refresh their cached copy about every 24 hours. You can ask for a faster refresh with the Request a recrawl function in Search Console’s robots.txt report.
Should I block AI crawlers?
That is a business decision about whether you want your content used and cited by AI search tools. Each crawler has its own user-agent name, so you can write a separate group for it. Our strategic AI consulting can help you decide.
Sources
- Robots.txt Introduction and Guide, Google Search Central
- Create and Submit a robots.txt File, Google
- How Google Interprets the robots.txt Specification
- Updating Your Robots.txt File, Google
- Block Search Indexing with noindex, Google
- Robots Meta Tags Specifications, Google
- Page indexing report, Search Console Help
- An introduction to robots.txt files, Digital.gov
- robots.txt configuration, MDN
- Invalid robots.txt, Chrome Lighthouse
- The ultimate guide to robots.txt, Yoast
- Google On Robots.txt: When To Use Noindex vs. Disallow, Search Engine Journal
- Google drops 2007 rule requiring blocked internal search pages, PPC Land
Recommended
Table of Contents




