Created
April 25, 2013 19:10
-
-
Save chrisvogt/5462299 to your computer and use it in GitHub Desktop.
Cleans up the Wordpress header
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 | |
// Clean up the wordpress header by filtering out the following items from WP_HEAD(): | |
function NAMESPACE_header_cleanup() { | |
// Really Simple Discovery | |
remove_action('wp_head', 'rsd_link'); | |
// Windows Live Writer | |
remove_action('wp_head', 'wlwmanifest_link'); | |
// WordPress Generator | |
remove_action('wp_head', 'wp_generator'); | |
// Post Relational Links - Start | |
remove_action('wp_head', 'start_post_rel_link'); | |
// Post Relational Links - Index | |
remove_action('wp_head', 'index_rel_link'); | |
// Post Relational Links - Next, Prev | |
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); | |
// Clean up saved content; strip the auto <p> tag addition | |
remove_filter('the_content', 'wpautop'); | |
} | |
add_action('init','NAMESPACE_header_cleanup'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment