Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celticwebdesign/18d5694ccd1962375d96a9db87c95ace to your computer and use it in GitHub Desktop.
Save celticwebdesign/18d5694ccd1962375d96a9db87c95ace to your computer and use it in GitHub Desktop.
// HOW TO ENABLE HTTP STRICT TRANSPORT SECURITY (HSTS) IN WORDPRESS
// https://thomasgriffin.io/enable-http-strict-transport-security-hsts-wordpress/
add_action( 'send_headers', 'tgm_io_strict_transport_security' );
/**
* Enables the HTTP Strict Transport Security (HSTS) header.
*
* @since 1.0.0
*/
function tgm_io_strict_transport_security() {
header( 'Strict-Transport-Security: max-age=10886400; includeSubDomains; preload' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment