How to Remove WordPress Header Extras

If you are looking to remove all of the “extra crap” wordpress inserts into the header by default, then look no further.

Simply place this code into the top of your “functions.php” of your current them and save it.

<?php

/*** overrides ***/
remove_action( ‘wp_head’, ‘feed_links’);
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’, ‘adjacent_posts_rel_link_wp_head’);
remove_action( ‘wp_head’, ‘wp_generator’);
remove_action( ‘wp_head’, ‘wp_shortlink_wp_head’);
/*** overrides ***/

 

Was this blog post helpful for you?

Support my blog and donate!

My blog is open to the public and will always be freely available. With your donation, we can help others learn, together.