Context
Turning on Search for Agents creates a Cloudflare AI Search instance that crawls the site in discover mode. The crawl can pick up pages you don’t want in the index, such as:
- duplicate hosts (for example, an apex domain that serves 200 instead of redirecting to
www) rss.xmland tag pages- trailing-slash variants of the same URL
The trap
Deleting a web-crawler item through the namespaced items endpoint returns 404 item_not_found, with or without the namespace in the path. A GET on the same item ID succeeds. Pages the crawler can no longer reach aren’t removed on their own either.
What works
Add exclude patterns to the instance’s source_params:
"source_params": { "exclude_items": [ "https://apex.example/**", "https://www.example/*/" ]}- Patterns match the full URL, including scheme and host.
- Updating the instance starts a resync automatically.
- The resync marks matching entries as skipped, which removes them from search results.
Takeaway: to clean up an index that holds pages you don’t want, filter them out with exclude patterns; deleting items through the API doesn’t work.