AI Search — Website Source CSS content selectors
Key Points
- CSS selectors paired with URL globs
- First-match wins; evaluated in order
- Limit of 10 selector entries per instance
Summary
AI Search now supports CSS content selectors for website data sources. You can pair URL glob patterns with CSS selectors so the crawler extracts only the relevant page fragments (ignoring navigation, sidebars, footers, etc.). Matched elements are converted to Markdown and indexed. Configure selectors via the dashboard or the API.
Key Points
- Specify content selectors as
{ "path": "<glob>", "selector": "<css>" }(e.g.{"path":"**/blog/**","selector":"article .post-body"}). - Selectors are evaluated in order; the first matching pattern wins.
- You can define up to 10 content selector entries per instance.
- Extracted elements are converted to Markdown before indexing to improve relevance.
- Configure via dashboard or API (
POST https://api.cloudflare.com/client/v4/accounts/{account_id}/ai-search/instances).
Practical notes
- Use specific globs to avoid unintended matches.
- Validate selectors against representative pages before deploying.
- Monitor indexing results to confirm only desired content is captured.