WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove comments rss feed link (12 posts)

  1. RachelKaye
    Member
    Posted 4 years ago #

    I'm wondering how to remove the comments rss feed link from the source of your page, not the actual visible link, but the "<link rel="alternate" type="application/rss+xml"... etc in the source code.

    Thanks.

  2. Samuel B
    moderator
    Posted 4 years ago #

    open your theme's header.php and remove it?

  3. RachelKaye
    Member
    Posted 4 years ago #

    Thank you for your reply.

    My header.php doesn't contain the code, I think it is generated automatically by the wp_head.

  4. RachelKaye
    Member
    Posted 4 years ago #

    Any help would be much appreciated.

  5. nuiloa
    Member
    Posted 4 years ago #

    Same issue here, how do I remove that comments rss feed?

    I'm using thesis, so I don't have access to the header.php file. Even if I did, shouldn't there be a cleaner way to do this?

    My comments' RSS feed appears before my posts' RSS feed in the header, so people trying to subscribe get the comments RSS feed instead. Not good.

  6. RachelKaye
    Member
    Posted 4 years ago #

    My header.php file doesn't contain it, I don't understand why no one is responding here, surely someone else has wanted to remove it in the past? Is it something that obvious and that's why no one is replying?

    Please post if you know anything about it, it's a big problem for me because the url that accesses the comments feed: mysite.com/comments/feed leads to a broken page because I actually have a folder on my site called mysite.com/comments.

    Literally going crazy here, removing the call to wp_head removes both RSS feeds but most of my plugins aren't working if I do that!

  7. RachelKaye
    Member
    Posted 4 years ago #

    Anyone?

  8. RachelKaye
    Member
    Posted 4 years ago #

    Still looking please.

  9. Adam Harley
    Member
    Posted 4 years ago #

    Put remove_action( 'wp_head', 'feed_links' ); in your theme's functions.php (or if you haven't got one, make one and put <?php and ?> on new lines around the above.

    You'll have to add in the link tag for your main RSS feed manually if you want it in your header.php again with something like:
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />

    @RachelKaye: Yep, removing the wp_head() call is a very, very bad idea.

  10. RachelKaye
    Member
    Posted 4 years ago #

    Thank you very much for that Kawauso.

  11. xiatica
    Member
    Posted 4 years ago #

    removing this from functions works

    remove_action( 'wp_head', 'feed_links' );

  12. btard
    Member
    Posted 3 years ago #

    Old topic but....

    Put remove_action( 'wp_head', 'feed_links' ); in your theme's functions.php

    This doesn't appear to remove this:

    <link rel="alternate" type="application/rss+xml" title="Site &raquo; Feed" href="http://localhost/feed" />
    <link rel="alternate" type="application/rss+xml" title="Site &raquo; Comments Feed" href="http://localhost/comments/feed" />

    This is what I'm removing through theme's functions.php file

    remove_action( 'wp_head', 'feed_links' );
    remove_action( 'wp_head', 'rsd_link');
    remove_action( 'wp_head', 'wlwmanifest_link');
    remove_action( 'wp_head', 'index_rel_link');
    remove_action( 'wp_head', 'parent_post_rel_link');
    remove_action( 'wp_head', 'start_post_rel_link');
    remove_action( 'wp_head', 'adjacent_posts_rel_link');
    remove_action( 'wp_head', 'wp_generator');

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.