kimaai_embedding_skip_block_names

When it fires

Only in the fallback of the text extraction. A post is indexed from its rendered content; when that gives fewer than 40 characters of text (blocks that render only images, or content a page builder renders elsewhere), KimaAI also walks the post’s blocks and adds their text: ACF blocks (acf/...) with the values of their fields, other blocks with their rendered HTML. That walk applies the filter once per block and leaves out the blocks it returns, inner blocks included.

The filter does not change the rendered content, which is what most posts are indexed from. To keep a block’s output out there, remove its markup by class with kimaai_embedding_remove_node_class_sets, or a shortcode’s with kimaai_embedding_shortcode_blocklist.

Parameters

NameTypeDescription
block_namesstring[]Block names to skip, gravityforms/form by default.
postWP_PostThe post being prepared for the knowledge base.

Returns

string[]: The block names to skip.

Example

add_filter(
  'kimaai_embedding_skip_block_names',
  function (array $block_names): array {
    // The newsletter block is on every page and says nothing about it.
    $block_names[] = 'acme/newsletter-signup';

    return $block_names;
  }
);
  • kimaai_embedding_remove_node_class_sets: removes elements of the rendered content by class.
  • kimaai_embedding_render_mode: how the content is rendered.

What are your feelings