Last active
September 25, 2015 22:48
-
-
Save roose/997878 to your computer and use it in GitHub Desktop.
Disable automatic generated Wordpress headers
This file contains 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
<?php | |
/** | |
* Disable automatic generated Wordpress headers | |
*/ | |
// Disabling XMLRPC | |
add_filter('xmlrpc_enabled', '__return_false'); | |
// Remove WordPress Admin Bar | |
remove_action('init', 'wp_admin_bar_init'); | |
// Disable RSS <link /> in header. | |
automatic_feed_links(false); | |
// Remove Wordpress "generator" tag | |
add_filter( 'show_admin_bar', '__return_false' ); | |
// Remove index/next/prev meta tags | |
remove_action('wp_head', 'index_rel_link'); | |
remove_action('wp_head', 'parent_post_rel_link', 10, 0); | |
remove_action('wp_head', 'start_post_rel_link', 10, 0); | |
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); | |
// Disable Windows Live Writer | |
remove_action('wp_head', 'wlwmanifest_link'); | |
remove_action('wp_head', 'rsd_link'); | |
// Remove canonical link | |
remove_action('wp_head', 'rel_canonical'); | |
// Remove shortlink | |
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); | |
// Remove generator tag | |
remove_action('wp_head', 'wp_generator'); | |
// Remove atranslate headers(if need) | |
remove_filter('wp_head', 'qtrans_header'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment