• davide

    (@davidemetupit)


    Hi!
    I have 5 blogs on WordPress, and in no one I use WordPress comments (I prefer social comments like FaceBook, etc.. ),
    It could to be good to hide comments feed link in html when there are no comments and comments are not active,

    Thank you for all,
    Davide

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    It’s not really a use case for most WordPress users (my feed reeder picks up comments too) but this ought to work for you.

    // Remove auto generated feed links
    function my_remove_feeds() {
    	remove_action( 'wp_head', 'feed_links_extra', 3 );
    }
    add_action( 'after_setup_theme', 'my_remove_feeds' );

    I’ve not tested it but it ought to remove comment, category and comment feeds from your installation. That can go into a plugin or your theme’s functions.php file.

    Thread Starter davide

    (@davidemetupit)

    Problem is.. that it is an error if WordPress links a page that doesn’t exists ??
    /comments/feed/ returns 404 if comments are not active,
    despite this WordPress links it anyway

    hope this helps,
    Davide

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It IS a 404. There are no comments and thus that page stops existing.

    What are you expecting to happen when you go to /comments/feed/ ?

    Thread Starter davide

    (@davidemetupit)

    I expect just that there isn’t any reference to that page in html ?? ,
    I mean, when page stops existing, link to that page stops too (this link: <link rel="alternate" type="application/rss+xml" title="TITLE" href="DOMAIN/comments/feed/" /> )

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Suggest, /comments/feed/ hidden when no comments and comments not active’ is closed to new replies.