WordPress: Cannot get rid of All

Recently, I updated by site: I am using WordPress: in one of the past updates, I noticed that WordPress added different link elements inside the head section. I thought about removing them but then decided to not do it.

In the recent update, when I saw another link element being added, that is when I finally decided to permanently stop these link elements from showing up. I may be wrong but I think that these elements may not help me or my site visitors or the search engines bots in anyway.

Anyway, one of the elements that I wanted to remove was this one:

<link rel="alternate" type="application/rss+xml"

This element is related to RSS/Feed of a site/blog: so then why am I removing it?

I personally think that if anyone is interested in subscribing to my site’s feeds, then he can use the link I have provided: RSS link is provided on all pages of my site.

The above mentioned element will help some RSS Readers to recognize the feeds but I think that I will remove it and will let users subscribe manually : ) I think this element help browsers like Flock to detect feed: but again: if anyone wants to subscribe, then he can still do it via going to the link provided on all pages.

Anyway, I wanted to remove this link element and I tried to do so via entering this code:

remove_action('wp_head', 'feed_links_extra' );
remove_action('wp_head', 'feed_links' );

In this file:

functions.php

One needs to edit the “functions.php” file that is present in the theme which is in use.

However, this code failed to remove one last Alternate Link Element from my site. I was quite confused as this is the code I have seen in many different online sources and it was suppose to remove all the link element that are related to RSS.

After searching for lot of time, I failed to find any more info on the internet. Then I tried to do it myself: after sometime, I was able to figure out what the issue was.

Instead of the above mentioned code, we need to use this code:

remove_action('wp_head', 'feed_links_extra', 3 );
remove_action('wp_head', 'feed_links', 2 );

This is the code that will remove all elements from your site that are related to RSS/Feeds.

Please Note: Before you remove this element from your site, make sure you know what this element is and why it is used. If you have lot of subscribers, then you may not want to delete this element.

  1. WordPress Plugin: Send an Email Notification ONLY IF Someone Replies to My Comment
  2. WordPress: How to remove Elements from the Head Section: Via Editing the Core Files?
  3. How to Remove CleverPlugins Advertisement/News from WordPress Dashboard
  4. WordPress: How to remove the Index, Start, Next, Prev Link Elements
  5. WordPress: How to remove the Shortlink Link Element

*