# robots.txt

> The `robots.txt` file is a plain text file placed in the root directory of your website that provides instructions to web crawlers about which parts of your site they should or should not visit. It acts as a set of guidelines, telling bots where to focus their limited crawl resources.

Search engine optimisation · Updated 2026-08-29 · [Marketing glossary](https://www.getlooploop.com/glossary)

**In short** Think of `robots.txt` as a signpost for search engine robots. You place this file on the main page of your website, and it contains simple rules that tell the bots which folders or pages they are allowed to look at. It helps manage how much effort (or 'crawl budget') those bots spend indexing your site.

## How the Directives Work: Crawl Control Basics

The file uses specific directives to communicate rules. The most important elements are the `User-agent` and the `Disallow:` commands. The `User-agent` specifies which bot (or 'crawler') the rule applies to—you can target all bots using `*` or specify a particular one like Googlebot. Following that, `Disallow:` tells the targeted user-agent what paths it must ignore. For example, if you want to block access to your internal staging area, you would use `Disallow: /staging/`. It is crucial to understand that this file only controls *crawling*, not *indexing*. A bot can be told not to crawl a page but still find and index it if other parts of the web point to it.

## Concrete Actions: What Marketers Should Do This Week

Review your `robots.txt` file specifically looking for paths that contain sensitive or redundant content, such as login pages, administrative dashboards, or automatically generated parameter URLs (e.g., tracking codes). If you have a large site with many deep, non-essential sections—like user profile history or old archive folders—use the `Disallow:` directive to block crawlers from wasting time on them. By limiting crawl depth to only your most valuable, brand-defining content, you ensure that search engines allocate their 'crawl budget' efficiently toward pages that actually matter for AI search results.

## How to Verify If Your Rules Are Working

You cannot rely solely on observing search results; you must check the crawl behavior directly. Use developer tools or dedicated site auditing tools that simulate a bot request against your `robots.txt` file. These tools will confirm if the directives are parsed correctly and if the specified paths are indeed blocked from crawling. If a critical page is not being crawled, it suggests either an incorrect directive or that another mechanism (like a meta tag) is overriding the instruction. Consistent monitoring ensures your site structure remains clean for AI consumption.

## Common Mistakes to Avoid When Using robots.txt

Misusing this file can inadvertently hide valuable content or fail to block necessary areas. Always treat the directives as suggestions, not absolute commands.

- **Warn:** Assuming `robots.txt` prevents indexing. It only stops *crawling*. If a page is linked to elsewhere, Google may still index it even if you block it in this file. — warn
- **Warn:** Blocking entire directories without checking content. You might accidentally block an important subdirectory that contains core product information simply because the folder name is generic. — warn
- **Check:** Ensuring the file is accessible and correctly placed in the root directory (`yourdomain.com/robots.txt`). Any deviation will cause bots to ignore it or fail to find it entirely. — check

## When robots.txt Does Not Apply (Or What It Is Confused With)

The `robots.txt` file is a protocol-level instruction, making it distinct from content-level instructions. For example, if you need to tell search engines that a page exists but should not be shown in results—regardless of whether they crawl it or not—you must use the `noindex` meta tag within the `` section of that specific HTML page. Similarly, canonical tags (`rel="canonical"`) are used to point crawlers toward the preferred version of content when duplicate versions exist. These methods operate at the document level, while `robots.txt` operates at the site structure level.

## Worked Example: Blocking Internal Tools

Imagine your website has a user portal at `/user/` and an internal testing area at `/dev/`. You want to allow Googlebot to crawl everything else but block access to these two areas. Your file would look like this:

> User-agent: * Disallow: /user/ Disallow: /dev/

## Prioritize Indexing Over Blocking

If the goal is to prevent content from appearing in AI search results, never rely solely on `robots.txt`. Always use a combination of techniques, prioritizing explicit meta tags like `noindex` or managing structured data markup.

## Frequently asked questions

### If I use a `robots.txt` directive, does that guarantee the content won't show up in search results?

No, using a `robots.txt` directive does not guarantee that content will be completely blocked from showing up in search results. It merely tells compliant crawlers which resources they should avoid wasting time on during their crawl process. Search engines may still index the URL based on other signals, such as links pointing to it or cached versions.

### What is the difference between using `robots.txt` and adding noindex meta tags?

The primary difference is that `robots.txt` is a protocol-level instruction that controls *crawling*, telling bots where they are allowed to go. Conversely, a noindex tag is a content-level instruction that tells the bot what to do *after* it has successfully crawled and viewed the page content, instructing it not to include the page in its index.

### If I change my `robots.txt` file, how long until Google knows about the changes?

There is no precise timeline for when search engines will discover or adopt your changes. While you can submit updated sitemaps and request re-crawling through webmaster tools, propagation speed depends entirely on the crawler's natural crawl schedule and priority assignment. You must monitor coverage reports to confirm that the new rules are being respected.

### Should I use `robots.txt` to block pages that contain sensitive user data?

While it is a necessary first step, relying solely on `robots.txt` for blocking sensitive data is insufficient and risky. You should always combine this with technical measures like password protection, authentication requirements, and explicit noindex tags. `robots.txt` only manages crawl effort, not security.

### Does the file need to be in the root directory of my domain?

Yes, for maximum reliability and discoverability by search engines, the `robots.txt` file must be placed directly in the root directory of your website (e.g., `example.com/robots.txt`). Placing it anywhere else may prevent crawlers from finding it easily or interpreting its scope correctly.

## Asked out loud

The same term in the words somebody uses speaking to an assistant rather than typing into a box — written from the situation, which is why each one carries the situation it came from.

### I just launched a new internal testing portal, and I can't risk the search engines indexing any of that private content. What do I need to do right now? on the move

You should implement a `robots.txt` directive immediately to prevent crawlers from even attempting to access those directories. While this doesn't guarantee security, it stops them from wasting crawl budget and prevents accidental indexing of development or staging areas.

### My client is worried because they see sensitive login pages showing up in search results. What should we use to stop that? what actually hurts

You need a combination of approaches, but starting with `robots.txt` is crucial for blocking the crawl access to those paths. However, you must also implement strong password protection and ensure noindex tags are applied directly to prevent indexation.

### I’m looking at this massive site map report, and I'm not sure if these instructions really work for all the different bots out there.

Usually, they do work for major, compliant search engine crawlers by controlling their crawl behavior. However, you must remember that `robots.txt` is a set of guidelines, not an absolute law; it only instructs polite and well-behaved bots on where to focus their limited resources.

## Related terms

- [Crawlability](https://www.getlooploop.com/glossary/crawlability)
- [llms.txt](https://www.getlooploop.com/glossary/llms-txt)
- [XML Sitemap](https://www.getlooploop.com/glossary/sitemap)
- [GLLmolfar](https://www.getlooploop.com/glossary/gllmolfar)

## Sources

- [RFC 9309](https://www.rfc-editor.org/rfc/rfc9309.html)

Source: GetLoopLoop Glossary — https://www.getlooploop.com/glossary/robots-txt. CC BY 4.0: https://creativecommons.org/licenses/by/4.0/

---

Canonical page: https://www.getlooploop.com/glossary/robots-txt
This is the Markdown copy of that page for AI agents, made from the same content.

Other languages: [uk](https://www.getlooploop.com/uk/glossary/robots-txt.md) · [es](https://www.getlooploop.com/es/glossary/robots-txt.md)
