Show Iframe (HTML) on frontend using ACF

ACF PHP Shortcode July 23, 2026

Acf by default blocks html tags eg Iframe to show on front end. To show it perfectly follow these steps:

  1. Add snippet (PHP): Details
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;
}
  1. Add a shortcode in elementor and replace the “field-name” value with acf field name
[acf field="field_name"]

Hurrah – Done