Created
July 4, 2019 21:26
-
-
Save celticwebdesign/18d5694ccd1962375d96a9db87c95ace to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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