Remove 10 Unnecessary Tags From WordPress Header

Spread the love

WordPress auto makes a huge amount of inconsequential tags/elements that can back off your site and now and again cause security issues. For instance, the WP Generator header name gives away the present type of your WordPress site which is surely not something that you have to reveal. So we should perceive what these parts are and how to oust them.

Here Is Unnecessary Elements In WordPress Header

Here is a list of auto-generated header tags, that we will be removing unnecessary elements. Remove whatever you feel is unnecessary and keep the rest,

<link rel="profile" href="">
<link rel="pingback" href="#">
<link rel="alternate" type="application/rss+xml" title="Comments Feed" href="#" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="wlwmanifest.xml" />
<link rel='prev' title='#' href='#' />
<link rel='next' title='#' href='#' />
<meta name="generator" content="WordPress 4.1.1" />
<link rel='shortlink' href='#' />
<link rel='index' title='#' />
<link rel='start' title='#' />

Removing XMLRPC, WLW, Generator, Feeds and ShortLink

To Remove these elements you will have to open you theme’s functions.php file and add a few lines of code to it.

remove_action('wp_head', 'rsd_link'); //removes EditURI/RSD (Really Simple Discovery) link.
remove_action('wp_head', 'wlwmanifest_link'); //removes wlwmanifest (Windows Live Writer) link.
remove_action('wp_head', 'wp_generator'); //removes meta name generator.
remove_action('wp_head', 'wp_shortlink_wp_head'); //removes shortlink.
remove_action( 'wp_head', 'feed_links', 2 ); //removes feed links.
remove_action('wp_head', 'feed_links_extra', 3 ); //removes comments feed

Removing XFN (XHTML Friends Network) Profile Link and Pingback URL

The rel=profile link and rel=Pingback tags will be removed by editing the header.php file. To do this, open your template’s header.php file and remove the following lines:

<link rel="profile" href="">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

Leave a Reply

Your email address will not be published. Required fields are marked *

WP Twitter Auto Publish Powered By :