Skip to content

Instantly share code, notes, and snippets.

@twfahey1
Last active November 18, 2019 16:03
Show Gist options
  • Save twfahey1/cfbd1779a27f3474e4c9a2c1315b2ce2 to your computer and use it in GitHub Desktop.
Save twfahey1/cfbd1779a27f3474e4c9a2c1315b2ce2 to your computer and use it in GitHub Desktop.
Wordpress - Manipulate headers programmatically in plugin / theme
function add_header_auth( $headers ) {
if ( ! is_admin() ) {
$headers['X-Frame-Options'] = 'SAMEORIGIN';
}
return $headers;
}
add_filter( 'wp_headers', 'add_header_auth' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment