---
name: kimaai_embedding_supported_sources
type: filter
since: 1.4.9
tier: premium
feature: embeddings
area: embedding-search
summary: Changes the content sources the knowledge base offers, such as a post type without an admin screen.
parameters:
  - name: sources
    type: array
    description: Source definitions keyed by slug, each with slug, label, post_type, kind (post_type or attachment), mime_types for attachments and optional query_args.
returns:
  type: array
  description: The sources.
---

# kimaai_embedding_supported_sources

## When it fires

Each time KimaAI needs the list of sources: for the sources of the Sync tab and its list of posts per source, for the post types of the automatic sync setting, when a post is published, updated, unpublished or deleted (only a post of a source type is synced automatically, and only its chunks are removed then) and for the count in the diagnostics.

By default the sources are every post type that has an admin screen (`show_ui`) and is publicly viewable, and `attachment` for PDF files. A source of kind `post_type` needs `slug`, `label` and `post_type`; `query_args` are added to the query of its list in the Sync tab. Only published posts are synced.

Removing a source takes it out of these places, but not out of a sync without a post type (`wp kimaai vectors sync` without `--post_type`), and its chunks already indexed stay, even when their posts are unpublished later. To keep a post type out of the index and every answer, deny its posts with `kimaai_content_access_tokens`.

## Example

```php
add_filter(
  'kimaai_embedding_supported_sources',
  function (array $sources): array {
    // The FAQ entries are edited inside another screen and have no admin screen of their own.
    $sources['faq'] = [
      'slug' => 'faq',
      'label' => 'FAQ',
      'post_type' => 'faq',
      'kind' => 'post_type',
    ];

    return $sources;
  }
);
```

## Related

- `kimaai_embedding_fetch_query_args`: the query a sync fetches its posts with.
- `kimaai_embedding_source_title`: the title a source shows under answers.
