Skip to main content

Contact

What are you interested in?

Back to Glossary (R)
Glossary · R

robots.txt.

robots.txt is a text file in the web root that tells search engine crawlers which areas of a website they may visit and which they may not. It controls crawling — not indexing directly.

ROGLOSSARYDLM Digital

robots.txt — Explained in Detail

The file sits at /robots.txt in the root directory and is the first thing a well-behaved crawler requests when it arrives. Directives such as User-agent, Disallow and Allow define which paths a given bot is permitted to visit. Most files close with a Sitemap line pointing to the XML sitemap, which is the simplest way to make sure a crawler finds every URL you care about. The syntax is deliberately plain: one group per user agent, one rule per line.

One pitfall trips up almost everyone. robots.txt blocks crawling, not necessarily indexing. A page that is disallowed but linked from elsewhere can still end up in the index — listed without a snippet, because Google was never allowed to read it. If you need a page kept out of search results reliably, use a meta robots 'noindex' tag or password protection instead, and leave the page crawlable so that the noindex can actually be read.

A typical use: an online shop blocks its basket, internal search results and admin areas from crawling so that Google spends its crawl budget on the product and category pages that matter. In practice that is two lines — 'User-agent: *' followed by 'Disallow: /basket/' — and it blocks every bot for that path. The same logic applies to filter URLs and endless faceted navigation, which can otherwise generate thousands of near-identical addresses.

Use the file sparingly and deliberately. A stray 'Disallow: /' can shut an entire website out of the index, and that mistake usually surfaces weeks later as a collapse in traffic. After every change, test the result — the robots.txt report in Google Search Console shows exactly how Google parses your file, and the URL inspection tool confirms whether a specific address is blocked. Five careful lines beat fifty defensive ones.

Related Page

XML Sitemap

Frequently Asked Questions About robots.txt

Not reliably. robots.txt prevents a page from being crawled, but a blocked URL that is linked from another site can still appear in the index without a content preview. To keep a page out of the search results for certain, use the meta robots 'noindex' tag or password protection — and leave the page crawlable, so that the noindex instruction can actually be read.

It is not strictly required — if the file is missing, crawlers assume they may visit everything. It is still worth having. It steers crawl budget, keeps unimportant areas out of the way and points to the XML sitemap with a single Sitemap line. Even a short, correct robots.txt counts as part of the technical SEO baseline for any site.

Ready for Your Project?

Apply this knowledge to your website — DLM Digital will help you.