---
title: "Cloudflare AI Search: crawled pages can't be deleted through the API, only excluded"
url: "https://www.dariuszparys.com/notes/cloudflare-ai-search-crawled-pages-only-excluded"
author: "Dariusz Parys"
published: 2026-11-26T00:00:00.000Z
description: "Deleting a crawled page from a Cloudflare AI Search index through the items endpoint returns 404 item_not_found, so unwanted pages have to be filtered out with exclude patterns in the instance's source_params."
tags:
  - "AI"
  - "Cloudflare"
---

# Cloudflare AI Search: crawled pages can't be deleted through the API, only excluded

## 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.xml` and 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`:

```json
"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.
