Skip to content

Instantly share code, notes, and snippets.

@ricksportel
Last active April 8, 2016 09:04
Show Gist options
  • Save ricksportel/6af5542c80e6783a32f5250ad8e9f578 to your computer and use it in GitHub Desktop.
Save ricksportel/6af5542c80e6783a32f5250ad8e9f578 to your computer and use it in GitHub Desktop.
<?php
//* Add the code snippet below to your WordPress child theme's functions.php
add_action( 'send_headers', 'child_themename_strict_transport_security_header' );
/**
* Enables the HTTP Strict Transport Security (HSTS) header.
*
* @since 1.0.0
*/
function child_themename_strict_transport_security_header() {
header( 'Strict-Transport-Security: max-age=10886400; includeSubDomains; preload' );
}
@ricksportel
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment