Skip to content

Instantly share code, notes, and snippets.

@roelven
Created July 22, 2010 10:32
Show Gist options
  • Save roelven/485822 to your computer and use it in GitHub Desktop.
Save roelven/485822 to your computer and use it in GitHub Desktop.
Remove ugly stuff in Wordpress' wp_head
<?php
//
// Put this in your templates' functions.php for a cleaner header:
//
function remove_x_pingback($headers) {
unset($headers['X-Pingback']);
return $headers;
}
function remove_comments_rss( $for_comments ) {
return '';
}
// Remove unnecessary bloat in wp header
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'rsd_link');
add_filter('wp_headers', 'remove_x_pingback');
add_filter('post_comments_feed_link_html','remove_comments_rss');
add_filter('post_comments_feed_link','remove_comments_rss');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment