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.

Parameters

NameTypeDescription
shortcodesstring[]Shortcode tags that are not rendered; none by default.
postWP_Post|nullThe post being prepared for the knowledge base.

Returns

string[]: The shortcode tags to leave out.

Example

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;
  }
);
  • 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.

What are your feelings