Skip to content

Instantly share code, notes, and snippets.

@natehefner
Last active August 29, 2015 14:06
Show Gist options
  • Save natehefner/6ab958917a35d1f9db3b to your computer and use it in GitHub Desktop.
Save natehefner/6ab958917a35d1f9db3b to your computer and use it in GitHub Desktop.
WordPress Theme Security
function remove_header_info() {
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'start_post_rel_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
}
add_action('init', 'remove_header_info');
function remove_wp_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) ) {
$src = remove_query_arg( 'ver', $src );
}
return $src;
}
add_filter( 'style_loader_src', 'remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'remove_wp_ver_css_js', 9999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment