I am currently working on the completion of a custom template and my last hurdle is to be able to remove the comments feed link being added to the head of the page.
For example: in firefox when you open any of the pages on my site there is an rss icon, when clicked I am shown 3 options to add to my reader but the last two are related to comments.
The culprits are located in the
<link rel="alternate" type="application/rss+xml" title="Example Title » Comments Feed" href="http://example.com/comments/feed" />
<link rel="alternate" type="application/rss+xml" title="Example Title » Home Page Comments Feed" href="http://example.com/home-page/feed" />
I wish to have the main feed, which contains blog posts from the blog area of the site but do not want any comments, therefore comment feeds are useless to me!
I am wondering if there is a way I can remove these via the functions.php or some way through wordpress rather than coming up with another (messier) solution?
Thanks,
Tristan
Add this to
functions.php
This is what most plugins and devs use:
Add it in your theme’s functions.php (before the last
?>
if you don’t know what you are doing).None of the above solutions worked for me on WordPress 3.3.2.
In a category page, for example I had:
To remove the first and the second line (main feed and comments feed), I’v haded the following code to /wp-content/themes/my-theme-name/functions.php
On main page none of those will be displayed.