Forums

How Do You Remove ALL Feeds From WP 3.05 (6 posts)

  1. kay9
    Member
    Posted 1 year ago #

    I have searched and found a couple of very old answers to this question.

    Can someone tell me how to remove all feeds from a WP blog using the latest (3.05) version of WP?

    I sure would be grateful. Thank you!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    The best that I could come up with is:

    // Disable feeds
    function my_disable_feed() {
    	wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') );
    }
    add_action('do_feed', 'my_disable_feed', 1);
    add_action('do_feed_rdf', 'my_disable_feed', 1);
    add_action('do_feed_rss', 'my_disable_feed', 1);
    add_action('do_feed_rss2', 'my_disable_feed', 1);
    add_action('do_feed_atom', 'my_disable_feed', 1);

    which you can add to your theme's functions.php

  3. kay9
    Member
    Posted 1 year ago #

    Thank you so much! I will try it. :-)

    How about if I just delete feed-related files? All of them. Wherever they are. Not that I know where they are. Or which ones.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    I'd stay away from the core files, if I was you. Deleting odd files may cause problems elsewhere. Last time I tried the above code, it stopped any feed requests dead in their tracks.

  5. kay9
    Member
    Posted 1 year ago #

    Thanks for helping, again. I did try the code and it made all kinds of errors for me. Sorry but I kinda gave up for now. But thank you!

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    It's worked for me in the past (used again only a few weeks ago, in fact). Perhaps you added it in the wrong place within functions.php - ie inside an existing function or outside of the opening <?php and closing ?> tags?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags