Title: WP_Customize_Manager::filter_iframe_security_headers
Published: December 7, 2016
Last modified: August 20, 2026

---

# WP_Customize_Manager::filter_iframe_security_headers( array $headers ): array

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_customize_manager/filter_iframe_security_headers/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_customize_manager/filter_iframe_security_headers/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_manager/filter_iframe_security_headers/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_manager/filter_iframe_security_headers/?output_format=md#changelog)

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

Filters the X-Frame-Options and Content-Security-Policy headers to ensure frontend
can load in customizer.

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

 `$headers`arrayrequired

Headers.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_customize_manager/filter_iframe_security_headers/?output_format=md#return)󠁿

 array Headers.

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

    ```php
    public function filter_iframe_security_headers( $headers ) {
    	$headers['X-Frame-Options']         = 'SAMEORIGIN';
    	$headers['Content-Security-Policy'] = "frame-ancestors 'self'";
    	return $headers;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-customize-manager.php#L1971)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-customize-manager.php#L1971-L1975)

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

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

## User Contributed Notes

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