Skip to content

Instantly share code, notes, and snippets.

@chrisvogt
Created April 25, 2013 19:10
Show Gist options
  • Save chrisvogt/5462299 to your computer and use it in GitHub Desktop.
Save chrisvogt/5462299 to your computer and use it in GitHub Desktop.
Cleans up the Wordpress header
<?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