Skip to content

Instantly share code, notes, and snippets.

@rdimascio
Last active October 7, 2018 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdimascio/a5058c788201fa20510330114b23628f to your computer and use it in GitHub Desktop.
Save rdimascio/a5058c788201fa20510330114b23628f to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Fix WPHead
Plugin URI: https://ryan.dimasc.io/wp/plugins
Description: Removes unnecessary clutter from WPHead.
Version: 1.0.0
Author: Ryan DiMascio
Author URI: https://ryan.dimasc.io
*/
// Remove RSD, XMLRPC, WLW, WP Generator, ShortLink, Comment Feed, and Prev/Next article links*/
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wp_shortlink_wp_head');
remove_action( 'wp_head', 'feed_links', 2 );
remove_action('wp_head', 'feed_links_extra', 3 );
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
// Remove WP Emoji
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment