[resolved] How do I remove RSS Feed and Comments from header? (6 posts)

  1. markcolclough
    Posted 7 years ago #

    Hi there


    Where do I find and delete the code that displays the RSS feed on my homepage header?

    Thank you!


  2. moshu
    Posted 7 years ago #

    Man, learn to post correctly your blog's link - it is : after http, not .

    Did you look around in your theme's directory? If you want to edit something in the header, shouldn't be the logical thing to look into the header.php?

  3. markcolclough
    Posted 7 years ago #

    hi there

    sorry, I have now edited the link above...

    Yes I have looked around header.php and I have removed

    <div id="feedarea">
    	<dt><strong><?php _e('Feed on','ml');?></strong></dt>
    	<dd><a href="<?php bloginfo('rss2_url'); ?>"><?php _e('Posts','ml');?></a></dd>
    	<dd><a href="<?php bloginfo('comments_rss2_url'); ?>"><?php _e('Comments','ml');?></a></dd>
    </div><!-- end id:feedarea -->

    but that didn't do the trick...

    any ideas?

    Thank you for your time

  4. markcolclough
    Posted 7 years ago #

    OK, I checked and that's all I need to do

    Thank you Moshu for pointing me in the right direction


  5. iphonethesolution
    Posted 6 years ago #

    Go to your theme and paste this in your function.php

     * Disable Our Feed Urls
    function disable_our_feeds() {
    	wp_die( __('<strong>Error:</strong> No RSS Feed Available, Please visit our <a href="'. get_bloginfo('url') .'">homepage</a>.') );
    add_action('do_feed', 'disable_our_feeds', 1);
    add_action('do_feed_rdf', 'disable_our_feeds', 1);
    add_action('do_feed_rss', 'disable_our_feeds', 1);
    add_action('do_feed_rss2', 'disable_our_feeds', 1);
    add_action('do_feed_atom', 'disable_our_feeds', 1);

    This will disable all rss feeds and atoms.


    [sig link moderated]

  6. squareink
    Posted 6 years ago #


    I tried this (using autofocus theme) and it doesn't remove it for me... I have however found where the rss code is:

    function sandbox_globalnav() {
    	echo '<div id="menu"><ul><li class="page_item"></li>';
        $menu = wp_list_pages('title_li=&sort_column=menu_order&echo=0'); // Params for the page list in header.php
        echo str_replace(array("\r", "\n", "\t"), '', $menu);
    	echo '<li class="page_item"><a href="'. get_bloginfo_rss('rss2_url') .'">RSS</a></li></ul></div>';

    Any ideas of what to comment out/ delete/ move? as I've tried a few things but not very good with the php code...

    many thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic