Skip to content

Commit ed2a787

Browse files
committed
[AI Search] add changelog
1 parent 7591a02 commit ed2a787

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: AI Search CSS content selectors for precise content extraction
3+
description: Control which parts of crawled pages are indexed using CSS selectors.
4+
products:
5+
- ai-search
6+
date: 2026-04-08
7+
---
8+
9+
[AI Search](/ai-search/) now supports [CSS content selectors](/ai-search/configuration/data-source/website/#content-selectors) for website data sources. You can now define which parts of a crawled page are extracted and indexed by specifying CSS selectors paired with URL glob patterns.
10+
11+
Content selectors solve the problem of indexing only relevant content while ignoring navigation, sidebars, footers, and other boilerplate. When a page URL matches a glob pattern, only elements matching the corresponding CSS selector are extracted and converted to Markdown for indexing.
12+
13+
Configure content selectors via the dashboard or API:
14+
15+
```bash
16+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/ai-search/instances" \
17+
-H "Authorization: Bearer {api_token}" \
18+
-H "Content-Type: application/json" \
19+
-d '{
20+
"id": "my-ai-search",
21+
"source": "https://example.com",
22+
"type": "web-crawler",
23+
"source_params": {
24+
"web_crawler": {
25+
"parse_options": {
26+
"content_selector": [
27+
{
28+
"path": "**/blog/**",
29+
"selector": "article .post-body"
30+
}
31+
]
32+
}
33+
}
34+
}
35+
}'
36+
```
37+
38+
Selectors are evaluated in order, and the first matching pattern wins. You can define up to 10 content selector entries per instance.
39+
40+
For configuration details and examples, refer to the [content selectors documentation](/ai-search/configuration/data-source/website/#content-selectors).

0 commit comments

Comments
 (0)