filter_block_content ( $text, $allowed_html = 'post', $allowed_protocols = array() )

  • (string) text Text that may contain block content.
  • (array[]|string) allowed_html Optional. An array of allowed HTML elements and attributes, or a context name such as 'post'. See wp_kses_allowed_html() for the list of accepted context names. Default 'post'.
  • (string[]) allowed_protocols Optional. Array of allowed URL protocols. Defaults to the result of wp_allowed_protocols().
  • (string) The filtered and sanitized content result.
Defined at:


Filters and sanitizes block content to remove non-allowable HTML from parsed block attribute values.

Related Functions

_filter_block_content_callback, filter_block_kses, register_block_core_post_content, register_block_core_pattern, wp_filter_out_block_nodes

Top Google Results

User discussions

wpseek mobile