Website Data Source Crawl: Parse Types, Sitemaps, Headers, and Content Selectors
How managed website crawling chooses pages, reaches protected sites, and extracts the right HTML for a semantic search index.
This page summarises Cloudflare AI Search documentation on connecting a Website data source: how the crawler finds URLs, when to use sitemap versus discover parse types, how to index login-protected pages, and how content selectors keep navigation and boilerplate out of the index. You can only crawl domains onboarded on the same Cloudflare account.
Website data source: what the crawler does after it finds a page
Section titled “Website data source: what the crawler does after it finds a page”AI Search turns each allowed page into searchable chunks. After discovery, it fetches the page, converts HTML to Markdown, splits content into chunks, and adds them to the instance index. The parse type setting controls how URLs are discovered; parsing and chunking are the same either way. See How website crawling works and Parse types.
AI Search finds the pages on your site, fetches each one, converts it to Markdown, splits it into chunks, and adds it to the index. The parse type controls how pages are found:
— Cloudflare, Website
Parse type sitemap versus discover: which discovery mode to use
Section titled “Parse type sitemap versus discover: which discovery mode to use”AI Search supports two parse types. sitemap (default) reads XML sitemaps and does not follow in-page links for discovery. discover starts at the source URL and, by default, collects candidates from both sitemaps and links found while crawling (via the Browser Run /crawl flow described in Parse types).
| Parse type | How pages are found | Prefer when |
|---|---|---|
sitemap |
XML sitemaps (from Parser options, robots.txt, or /sitemap.xml) |
Sitemap is complete and current |
discover |
Crawl job from source URL; default discovery source is all |
Sitemap missing, incomplete, or stale |
Both parse types can read your sitemaps, so the choice is not simply “sitemap or links”. discover defaults to a discovery source of all, which means it reads your sitemaps and follows links.
— Cloudflare, Parse types — Which parse type to use
Why keep sitemap when the sitemap is good
Section titled “Why keep sitemap when the sitemap is good”sitemap is usually more reliable when your sitemap already lists the pages you care about:
- Re-crawls track
<lastmod>on the next sync;discoverignores<lastmod>and<changefreq>and usesmax_ageinstead. discoverstops atlimitanddepth, so deep or peripheral pages can be skipped; sitemap indexing follows the sitemap list.- With
<priority>, sitemap mode can index higher-priority URLs first if you hit instance limits. - Specific sitemap URLs in Parser options apply only to
sitemap, notdiscover.
Choose discover when you need pages the sitemap omits. Changing parse type on an existing instance triggers a full resync (Parse types).
Sitemap parse type: robots.txt, specific sitemaps, and sync
Section titled “Sitemap parse type: robots.txt, specific sitemaps, and sync”How the crawler picks sitemap URLs
Section titled “How the crawler picks sitemap URLs”With sitemap, discovery order is:
- Custom sitemap URL(s) under Parser options → Specific sitemap (if set).
- Otherwise sitemaps listed in
robots.txt. - Otherwise
/sitemap.xml. - If no sitemap exists,
sitemapparse type cannot crawl — switch todiscover.
By default, AI Search crawls all sitemaps listed in your robots.txt in the order they appear (top to bottom).
— Cloudflare, Parse types — Specific sitemap
When you configure specific sitemaps, AI Search uses only those URLs instead of auto-discovery from robots.txt or /sitemap.xml (up to five URLs per instance). Example from the changelog: if robots.txt lists both blog-sitemap.xml and docs-sitemap.xml, you can set only https://example.com/docs-sitemap.xml to index documentation (Crawl only the sitemap you need). Apply changes under Settings → Parsing options → Specific sitemaps, then sync.
robots.txt and user agent Cloudflare-AI-Search
Section titled “robots.txt and user agent Cloudflare-AI-Search”The crawler uses user agent Cloudflare-AI-Search on domains in your account. It should be allowed and should reference your sitemap (Parse types — robots.txt). On discover, pages disallowed in robots.txt get indexing error blocked_by_robots_txt. The crawler declares search and ai-input crawl purposes; a site that sets either purpose to no in a robots.txt Content Signals directive rejects the crawl.
Sitemap sync and update behavior
Section titled “Sitemap sync and update behavior”On scheduled or manual sync, the crawler checks <lastmod>; if the date is after the last sync, the page is re-fetched and reindexed. Without <lastmod>, changefreq guides re-crawl timing; if neither is set, each URL is crawled about once per day (Parse types — Sync and updates).
Discover parse type: crawl source, depth, limits, and resync
Section titled “Discover parse type: crawl source, depth, limits, and resync”discover delegates discovery to a crawl job starting at the source URL. By default it uses sitemaps and link following; restrict with discover_options.source.
The crawler discovers and processes URLs in the following order (when using source: all, the default):
Starting URL — The URL specified in your request. Sitemap links — URLs found in the site’s sitemap. Page links — Links scraped from pages, if not already found in the sitemap.
— Cloudflare, How the crawler discovers URLs
Discovery source values: all, sitemaps, links (Discover options).
| Option | Default | Role |
|---|---|---|
limit |
100000 | Max pages per crawl (1–100000) |
depth |
5 | Max link hops from source (up to 100000) |
max_age |
86400 | Cache reuse before re-fetch (0–604800 s) |
include_external_links |
false | Follow other domains |
include_subdomains |
false | Follow subdomains of source |
Each sync starts a new crawl. AI Search reindexes returned pages and removes pages it can no longer reach. If a crawl stops early (limit or incomplete job), previously indexed pages are kept rather than deleting URLs the crawl did not reach (Sync behavior). parse_options.specific_sitemaps with discover returns a validation error.
Authentication headers: crawl login-protected and Access-protected pages
Section titled “Authentication headers: crawl login-protected and Access-protected pages”Without custom headers, only publicly reachable pages are indexed. You can add up to five HTTP headers per Website source (dashboard Extra headers under Parser options; API field source_params.web_crawler.parse_options.include_headers) (Authentication headers).
If your website has pages behind authentication or pages that are only visible to logged-in users, you can configure custom HTTP headers to allow the AI Search crawler to access this protected content.
— Cloudflare, Authentication headers
Typical uses: corporate SSO behind Authorization: Bearer <TOKEN>, premium gates, and Cloudflare Access with service tokens (AI Search support for crawling login protected website content). For Access, create a service token, add an Access policy with selector Service token, attach it to the self-hosted application, then set:
CF-Access-Client-IdCF-Access-Client-Secret
The crawler sends configured headers on every request. Adding or changing headers on an existing instance starts a new indexing job that reindexes every item (Configure in the dashboard).
Content selectors: index main article body, not chrome
Section titled “Content selectors: index main article body, not chrome”Content selectors pair a URL glob path with a CSS selector. The first matching path wins (order from most specific to least). Up to 10 entries; path and selector max 200 characters each (Content selectors).
When a page URL matches a glob pattern, only elements matching the corresponding CSS selector, and their descendants, are extracted and converted to Markdown for indexing.
— Cloudflare, Content selectors
Without selectors, AI Search strips elements such as <header>, <footer>, and <head> by default. Selectors apply to the HTML received — for client-rendered sites, use Rendered sites mode so selectors target the full DOM (Interaction with other features). Path filtering excludes URLs before crawl, so selectors never run on excluded paths. Updating selectors triggers an immediate sync.
Parser options shared by both parse types
Section titled “Parser options shared by both parse types”From Website — Configuration and Options that apply to both parse types:
- Path filtering — include/exclude URL globs.
- Rendering mode — raw HTML vs headless browser.
- Authentication headers — up to five.
- Content selectors — up to ten entries.
- Custom metadata — from
<meta>tags.
When creating an instance, type is optional: HTTP(S) URL infers web-crawler; an existing R2 bucket name infers r2 (Source type inference). Instances can also be created via the REST API or Workers binding (Workers binding).
Instance and crawl limits (website sources)
Section titled “Instance and crawl limits (website sources)”| Limit | Value |
|---|---|
| Pages per discover crawl | 100,000 |
| Discover depth (max hops) | 100,000 (default 5) |
| Discover cache age (max) | 604,800 s (7 days) |
| Specific sitemap URLs | 5 |
| Authentication headers | 5 |
| Content selector entries | 10 |
The files per instance cap still applies; the effective limit is the lower of crawl limits and instance file limits (Website — Limits).
Common mistakes
Section titled “Common mistakes”- Using
discoverwithout tuninglimit/depth/ path filters, then wondering why part of the site is missing. - Expecting
<lastmod>-driven updates ondiscover— usemax_ageinstead. - Setting specific sitemaps while on
discover(unsupported). - Blocking
Cloudflare-AI-Searchin WAF while indexing the same zone — use Bot Detection ID 122933950 in a Skip rule placed First (Allow AI Search through WAF). - Broad CSS selectors that match nothing, producing errored empty items.
How to check this on your site
Section titled “How to check this on your site”-
In the Cloudflare dashboard, open your AI Search instance and confirm parse type, sitemap or discover options, and that the source domain is onboarded on the account.
-
Fetch your site’s
robots.txtand confirmSitemap:entries and that user agentCloudflare-AI-Searchis allowed, following Parse types — robots.txt. -
Run a manual sync, then review indexed items for errors such as
blocked_by_robots_txtor failed content-selector extractions (Content selectors). -
If responses are blocked by security products, verify a WAF custom rule allows the AI Search bot per Allow AI Search through WAF.
-
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page looks wrong or you need a clarification, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.