Created
September 9, 2017 18:59
-
-
Save lgraubner/f736700a822b96fbe71d9d1fe0b692b1 to your computer and use it in GitHub Desktop.
Plugin to cleanup Wordpress head
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
<?php | |
/* | |
Plugin Name: WP Head Cleanup | |
Description: Removes unnecessary head parts | |
Version: 1.0.0 | |
Author: Lars Graubner | |
Author URI: https://larsgraubner.com | |
License: MIT License | |
*/ | |
function head_cleanup() { | |
// disable xmlrpc | |
add_filter('xmlrpc_enabled', '__return_false'); | |
// remove EditURI/RSD (Really Simple Discovery) link | |
remove_action('wp_head', 'rsd_link'); | |
// remove wlwmanifest (Windows Live Writer) link | |
remove_action('wp_head', 'wlwmanifest_link'); | |
// remove meta name generator | |
remove_action('wp_head', 'wp_generator'); | |
// remove feed links | |
remove_action('wp_head', 'wp_shortlink_wp_head'); | |
// remove feed links | |
remove_action('wp_head', 'feed_links', 2); | |
// remove comments feed | |
remove_action('wp_head', 'feed_links_extra', 3 ); | |
} | |
add_action('init', 'head_cleanup'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment