Created
December 3, 2016 02:03
-
-
Save peazz/4fe0abe0b0d83161aecb7c6b29583d7f to your computer and use it in GitHub Desktop.
Clean WordPress Head Output 2016
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pixel_wp_head_cleanup () { | |
remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer) | |
remove_action('wp_head', 'wp_generator'); // remove wordpress version | |
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link | |
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 ); // remove shortlink | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); // remove emojis | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); // remove emojis | |
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); // remove the / and previous post links | |
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', 'rest_output_link_wp_head', 10 ); // remove the REST API link | |
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); // remove oEmbed discovery links | |
remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 ); // remove the REST API link from HTTP Headers | |
remove_action( 'wp_head', 'wp_oembed_add_host_js' ); // remove oEmbed-specific javascript from front-end / back-end | |
remove_action('rest_api_init', 'wp_oembed_register_route'); // remove the oEmbed REST API route | |
remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10); // don't filter oEmbed results | |
remove_action( 'wp_head', 'dns-prefetch' ); // remove new prefetch | |
} | |
add_action('after_setup_theme', 'pixel_wp_head_cleanup'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment