Title: wp_kses_allowed_html
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘wp_kses_allowed_html’, array[] $html, string $context )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#wp--skip-link--target)

Filters the HTML tags that are allowed for a given context.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#description)󠁿

HTML tags and attribute names are case-insensitive in HTML but must be added to 
the KSES allow list in lowercase. An item added to the allow list in upper or mixed
case will not recognized as permitted by KSES.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#parameters)󠁿

 `$html`array[]

Allowed HTML tags.

`$context`string

Context name.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'wp_kses_allowed_html', $html, $context );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/kses.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/kses.php#L1080)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/kses.php#L1080-L1080)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_kses_allowed_html()](https://developer.wordpress.org/reference/functions/wp_kses_allowed_html/)`wp-includes/kses.php` |

Returns an array of allowed HTML tags and attributes for a given context.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/?output_format=md#comment-content-7252)
 2.   [dooza](https://profiles.wordpress.org/dooza/)  [  1 year ago  ](https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/#comment-7252)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_kses_allowed_html%2F%23comment-7252)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_kses_allowed_html%2F%23comment-7252)
 4. If you need to allow ACF to use iFrames you can use this:
 5. add_filter( ‘wp_kses_allowed_html’, ‘acf_add_allowed_iframe_tag’, 10, 2 );
     function
    acf_add_allowed_iframe_tag( $tags, $context ) { if ( $context === ‘acf’ ) { $tags[‘
    iframe’] = array( ‘src’ => true, ‘height’ => true, ‘width’ => true, ‘frameborder’
    => true, ‘allowfullscreen’ => true, ); } return $tags; }
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_kses_allowed_html%2F%3Freplytocom%3D7252%23feedback-editor-7252)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_kses_allowed_html%2F)
before being able to contribute a note or feedback.