Snippets

Remove default header information in wp_head

Paste the code into your functions.php to avoid WordPress from print a lot of information within . Use with care and modify to fit your website – some meta tags are worth keeping.

remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'parent_post_rel_link');
remove_action('wp_head', 'start_post_rel_link');
remove_action('wp_head', 'adjacent_posts_rel_link');
remove_action('wp_head', 'check_and_publish_future_post');
remove_action('wp_head', 'wp_print_styles');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'rel_canonical');
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );

Share this snippet

 
  • http://about.me/evanjacobs Evan Jacobs

    Nice list – I’d also add the following:

    remove_action( ‘wp_head’, ‘_ak_framework_meta_tags’ );