Skip to content

Instantly share code, notes, and snippets.

@rickrduncan
Created November 6, 2015 12:19
Show Gist options
  • Save rickrduncan/12feac07572b049800e2 to your computer and use it in GitHub Desktop.
Save rickrduncan/12feac07572b049800e2 to your computer and use it in GitHub Desktop.
<?php
//* Do NOT include the opening php tag
/**
* @purpose: Remove references to feed from <head> section of website
*
* @author: Rick R. Duncan
* @contact: www.rickrduncan.com
*
*/
function b3m_remove_header_junk() {
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
remove_action('wp_head', 'wp_generator'); // remove wordpress version
remove_action('wp_head', 'feed_links', 2); // remove rss feed links
remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
remove_action('wp_head', 'index_rel_link'); // remove link to index page
remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer)
remove_action('wp_head', 'start_post_rel_link', 10, 0); // remove random post link
remove_action('wp_head', 'parent_post_rel_link', 10, 0); // remove parent post link
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // remove the next and previous post links
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 ); // remove shortlink support
}
add_action('init', 'b3m_remove_header_junk');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment