Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
< ?php
* @package HSTS
* @version 1.0
Plugin Name: HSTS - HTTP Strict Transport Security enforcement plugin
Version: 1.0
Author URI:
function hsts_header()
isset($_SERVER['HTTPS']) && header('Strict-Transport-Security: max-age=15768000; includeSubDomains');
add_action( 'send_headers', 'hsts_header' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment