Skip to content

Instantly share code, notes, and snippets.

@roose
Last active September 25, 2015 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roose/997878 to your computer and use it in GitHub Desktop.
Save roose/997878 to your computer and use it in GitHub Desktop.
Disable automatic generated Wordpress headers
<?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