Remove excessive information from WordPress blog headers to increase security


If you don’t need some information that WordPress places by default in the header of your blog pages, such as rel links to the previous and next posts, or the version of WordPress that you use, you can easily remove them from your header without changing the core system files of WordPress.

Go to the folder of your theme (wp-content\themes\your-theme) and open the file functions.php.

Add there some or all of the following commands, according to what you wish to remove from the header of your blog:

[sociallocker message=”Share, and keep reading!”]

<?php
 remove_action( 'wp_head', 'feed_links_extra', 3 ); // extra feeds such as category feeds
 remove_action( 'wp_head', 'feed_links', 2 ); // Post and Comment Feed
 remove_action( 'wp_head', 'rsd_link' ); // Really Simple Discovery service endpoint, EditURI
 remove_action( 'wp_head', 'wlwmanifest_link' ); // Manifest file for Windows Live Writer
 remove_action( 'wp_head', 'index_rel_link' ); // Blog index
 remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // previous post link
 remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link
 remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Posts adjacent to the current post
 remove_action( 'wp_head', 'wp_generator' ); // WP version
?>

Enjoy!