Sub topic 3
How pages get crawled and indexed
This chapter assumes you know what a crawler is, can read basic HTTP status codes and headers, and have seen a robots.txt file. It explains how a page goes from "published" to "available for an answer engine to retrieve". If a page never enters an index, nothing later in the pipeline can cite it.
Why the index matters for answer engines
An answer engine does not read the live web when you ask a question. Most of the time it queries a prebuilt index, which is a searchable copy of page content that a crawler collected earlier. The language model then writes an answer from the passages that search returns.
This has three consequences:
- A page that is not in the index cannot be retrieved, however good it is.
- The index holds a snapshot. Changes you make today appear only after the page is crawled again and reprocessed.
- Each engine draws on its own index or a partner's index. Being indexed in one place does not mean being indexed in another. The chapter on engine sources covers which engine uses which.
Some engines can also fetch a page live when a user asks about a specific URL. That is a separate path, covered in the chapter on crawler user agents. The rest of this chapter covers the standard index path.
The crawl-to-index pipeline
Each stage is a place where a page can silently drop out. The sections below take them in order.
Discovery
A crawler needs a URL before it can fetch anything. It finds URLs in four main ways:
- Links from pages it already knows. This is the most common route. A page with no internal or external links pointing to it is hard to discover.
- Sitemaps. An XML file that lists your URLs, usually referenced from robots.txt.
- Direct submission. Protocols such as IndexNow, which the freshness chapter covers.
- Previous crawls. URLs seen before are revisited on a schedule.
The robots.txt check
Before fetching a URL, a well-behaved crawler requests /robots.txt from the same host and checks whether its own user-agent name is allowed to fetch that path. Rules are matched per user-agent group, so you can allow one crawler and block another. Two details cause most mistakes:
- If a crawler finds a group naming it, it generally follows that group and ignores the
*group. Rules do not merge across groups. - A robots.txt that returns a server error (5xx) can make some crawlers stop fetching the whole site until it recovers. A 404 for robots.txt usually means "no restrictions".
You can test your rules locally with Python's standard library:
from urllib.robotparser import RobotFileParser
robots_txt = """\
User-agent: GPTBot
Disallow: /
User-agent: *
Allow: /
"""
parser = RobotFileParser()
parser.parse(robots_txt.splitlines())
url = "https://www.example.com/guide"
for agent in ["OAI-SearchBot", "GPTBot", "PerplexityBot", "bingbot"]:
print(f"{agent}: {parser.can_fetch(agent, url)}")This prints False only for GPTBot. The other three fall through to the * group. The parser implements the robots exclusion rules, but each crawler's own parser may handle edge cases differently, so treat the result as a close check and not proof.
Fetching
The crawler sends an HTTP GET request and reads the response. What your server returns decides what happens next:
| Response | Typical crawler behavior |
|---|---|
| 200 | Content is parsed and considered for indexing |
| 301 / 308 | The crawler follows the redirect and usually treats the target as the real URL |
| 404 / 410 | The URL is dropped from the index after one or more rechecks. 410 signals removal more strongly |
| 429 / 503 | The crawler backs off and retries later. Persistent errors reduce crawl rate |
| 403 | Treated as blocked. A firewall or bot-protection rule that returns 403 to crawlers has the same effect as a Disallow |
Bot-protection services are a common cause of invisible blocking. Your robots.txt can say Allow while a web application firewall rejects the crawler's IP range or user agent. Check server logs for the status codes crawlers actually receive, not just your configuration.
Parsing and rendering
The crawler extracts text, links, the title, headings, and metadata from the HTML. Search engines such as Bing can run JavaScript to render a page. Many other crawlers fetch only the raw HTML and do not execute scripts. If your main content appears only after client-side JavaScript runs, a crawler that does not render sees an empty shell.
The safe approach is to make sure the important text is present in the initial HTML response. You can check this by fetching the page without a browser:
curl -s -A "Mozilla/5.0 (compatible; test)" https://www.example.com/guide | grep -c "a phrase from your main content"A count of 0 means the phrase is not in the server-delivered HTML, and a non-rendering crawler will not see it.
Deduplication and canonical selection
The same content often lives at several URLs: with and without www, with tracking parameters, with trailing slashes, or in print versions. The indexer clusters near-duplicates and picks one canonical URL to represent them. You can hint at your preference with <link rel="canonical" href="...">, consistent internal links, and redirects, but the engine makes the final choice.
This matters for citation. The URL shown to the user is the canonical one. If the engine picks a parameterized or duplicate version, your analytics and citations may point somewhere you did not intend.
Indexing
Indexing stores the processed content so it can be searched quickly. Two points are worth knowing:
- Crawled does not mean indexed. Engines fetch more pages than they keep. Thin, duplicated, or low-value pages may be fetched and then left out.
- Indexes are usually split into units smaller than a page. Many systems store passages or chunks with their own text representations, so retrieval can return a section of a page. The retrieval chapters cover this. For now, remember that each part of your page needs to make sense on its own.
Crawl budget and frequency
A crawler does not fetch every page on every site at once. It decides how often to return based on signals such as how often the page changed before, how many sites link to it, how fast and reliable your server is, and how much of your site it has already seen. Small sites rarely hit a hard limit. Large sites with many low-value URLs, such as faceted search pages, can waste crawl effort on pages nobody wants.
Practical consequences:
- Keep response times low and error rates near zero.
- Avoid infinite URL spaces such as calendars or filter combinations. Block them in robots.txt or use canonical tags.
- Update
dateModifiedand your sitemap'slastmodonly when the content actually changes. Crawlers learn to distrust dates that change without content changes.
Common failure modes
- Blocked at the wrong layer. robots.txt allows the crawler, but a CDN or firewall rule blocks it. Symptom: no log entries with 200 for that user agent.
- Content hidden behind JavaScript, logins, or cookie walls. The crawler indexes the wall, not your article.
- Accidental noindex. A
<meta name="robots" content="noindex">tag or anX-Robots-Tag: noindexheader, often left over from a staging environment, tells engines to exclude the page. - Redirect chains and loops. Long chains waste crawl effort and may be abandoned.
- Soft 404s. A page returns 200 but shows "not found" text. The engine may index the error message.
- Stale index. The page is indexed, but the version in the index is old. This is the topic of the sitemap and IndexNow chapter.
A short checklist
- Fetch your page with
curland confirm the main text is in the HTML. - Confirm the status is 200 with no redirect chain and no
noindexin the headers or meta tags. - Test each crawler name against your robots.txt.
- Confirm your firewall does not block the crawlers' IP ranges or user agents. Each vendor publishes the user-agent names and, for several of them, IP lists in its documentation.
- Check that the page is linked from other pages and listed in your sitemap.
- Confirm the canonical URL is the one you want shown.
Exercise
A page returns 200 and robots.txt allows bingbot, but the page never appears in Bing-based answers. Server logs show bingbot requests for that URL, and the response is an 200 with a near-empty HTML body, because the content is rendered by JavaScript after load. Name two checks you would run and one change you would make.
Show answer
Check the raw HTML with curl to confirm the main text is missing from the server response, and check for a noindex meta tag or X-Robots-Tag header on the page. Bing can render JavaScript, but rendering is not guaranteed to be complete or timely, and other crawlers may not render at all. Change the page to include the main content in the initial HTML, using server-side rendering or static generation.
Exercise
Your robots.txt contains a group "User-agent: *" with "Disallow: /private/" and a separate group "User-agent: OAI-SearchBot" with "Allow: /". Can OAI-SearchBot fetch /private/report? Why?
Show answer
Yes. A crawler that finds a group naming it follows that group and ignores the "*" group, so the Disallow on /private/ does not apply to OAI-SearchBot. If you want /private/ blocked for it too, add "Disallow: /private/" to the OAI-SearchBot group.