Skip to content

Instantly share code, notes, and snippets.

@pixelcoder
Created April 20, 2015 03:44
Show Gist options
  • Save pixelcoder/c8fe92fee70a9d49390c to your computer and use it in GitHub Desktop.
Save pixelcoder/c8fe92fee70a9d49390c to your computer and use it in GitHub Desktop.
WordPress: Get rid of wp_head() junk
# Remove junk
function px_wp_remove_head() {
remove_action('wp_head', 'feed_links');
remove_action('wp_head', 'feed_links_extra');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
remove_action('wp_head', 'locale_stylesheet');
remove_action('wp_head', 'noindex');
remove_action('wp_head', 'wp_print_styles');
remove_action('wp_head', 'wp_print_head_scripts');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'rel_canonical');
remove_action('wp_head', 'wp_shortlink_wp_head');
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', 'wp_generator');
}
add_action('wp_print_styles', 'px_wp_remove_head');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment