---
name: kimaai_embedding_shortcode_blocklist
type: filter
since: 1.3.1
tier: premium
feature: embeddings
area: embedding-search
summary: Lists shortcodes whose output stays out of the knowledge base.
parameters:
  - name: shortcodes
    type: string[]
    description: Shortcode tags that are not rendered; none by default.
  - name: post
    type: WP_Post|null
    description: The post being prepared for the knowledge base.
returns:
  type: string[]
  description: The shortcode tags to leave out.
---

# kimaai_embedding_shortcode_blocklist

## When it fires

Once per post in every sync of the knowledge base, right after `kimaai_embedding_render_mode` and before the content is rendered. PDFs do not pass it.

KimaAI unregisters each listed shortcode while it renders the post, in both render modes, and registers it again afterwards, so the shortcode keeps working on the site. Its tag is then removed from the text, so neither its output nor `[tag]` reaches the index. Tags that are not registered on the site are ignored.

Use it for shortcodes whose output is not content: forms, newsletter boxes, galleries, a cart. Forms rendered as HTML `<form>` are removed by KimaAI's cleaning anyway, but the headings and texts around them are not.

## Example

```php
add_filter(
  'kimaai_embedding_shortcode_blocklist',
  function (array $shortcodes): array {
    // The newsletter box and the booking calendar are on many pages and say nothing about them.
    $shortcodes[] = 'newsletter_signup';
    $shortcodes[] = 'booking_calendar';

    return $shortcodes;
  }
);
```

## Related

- `kimaai_embedding_render_mode`: how the post is rendered.
- `kimaai_embedding_skip_block_names`: blocks the fallback extractor leaves out.
- `kimaai_embedding_remove_node_class_sets`: removes elements of the rendered HTML by class.
