Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Disable RSS Feeds in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Disable RSS Feeds in WordPress

WordPress is one of the best Content Management System (CMS) available. There will be times that you will create a static website and does not want to implement RSS Feeds. But that feature is automatically included in WordPress and in order to turn it off, you would have to edit core files. But in this article we will show you how you can disable RSS Feeds without editing the core file by simply creating a function in WordPress.

Open your functions.php located within your themes folder and add the following code:

    function fb_disable_feed() {
    wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') );

    add_action('do_feed', 'fb_disable_feed', 1);
    add_action('do_feed_rdf', 'fb_disable_feed', 1);
    add_action('do_feed_rss', 'fb_disable_feed', 1);
    add_action('do_feed_rss2', 'fb_disable_feed', 1);
    add_action('do_feed_atom', 'fb_disable_feed', 1);
    add_action('do_feed_rss2_comments', 'fb_disable_feed', 1);
    add_action('do_feed_atom_comments', 'fb_disable_feed', 1);

Once you add this code, anytime someone tries to reach your feeds, they will see this message: “No feed available, please visit our homepage.” You can change the message to fit your needs.

Source: Frank from WPEngineer

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. imran says:

    bro please help me i used this code in my website now feed is disabled but i am receiving a lot of errors in webmaster tools, permalink-of-post.html/feed
    see this screen shot

  2. Faizan says:

    thanks for sharing this tutorial, you really made it simple.

  3. Artin says:

    I used to use this code in function.php and i woudl get 500 errors in GWT!
    But after i searched in google i found a plugin named ”Disable Feeds” and i installed it and it worked just like the code! but this plugin is better than that code because you wont get 500 errors in GWT! You can redirect feed to homepage!

  4. ParkerWest says:

    Worked like a charm! If you use any caching systems, be sure to clear them out after you add the code.

  5. sarnuji says:

    hey can you help me , i have done disabled rss fed but my conten stil stolen :'(

  6. WPBeginner Staff says:

    At the bottom just before the ?> tag

  7. RickyO says:

    Any specific location in the functions file it should go?

  8. WPBeginner Staff says:

    In some special usage scenarios a website owner may want to disable feeds.

  9. Erron says:

    why you need to disable your rss feed?

  10. Bridget says:

    Is it possible to disable rss feeds — for “non-members” of a site — but still allow members to use them?

  11. ubaid says:

    I used this code. But didn’t work. Any suggestions for me?

    I have placed the code correctly around php tags inside functions.php

  12. Nouman Younas says:

    I was searching for this, but i have a question..
    why websites disable feeds? what are the reasosn to take such step?

  13. Will says:

    Do you know if it’s possible to remove just Tag and Category Feeds from a WP install that has the Atahualpa Theme?

    I think 1 Main RSS feed is enough.

    I don’t have users asking for anything more specific, and the software publishing it the way it does seems overkill and dilutionary.

    Any ideas?

  14. chandler says:

    I copied and pasted this. When I clicked enter it took me to a 500 error.
    I can no longer access my site.

    I’m not the server admin, and not sure how to manually access the functions.php file.

    Please help.

    • Editorial Staff says:

      Are you sure that you pasted this in the right functions.php file which is located in your themes folder?

  15. josef says:

    hi thanks!
    can i blok feed&rss… for costume post type only?

  16. Luke says:

    I would also add following code in order to hide feeds also for comments

    add_action(‘do_feed_rss2_comments’, ‘fb_disable_feed’, 1);
    add_action(‘do_feed_atom_comments’, ‘fb_disable_feed’, 1);

  17. Vishesh Kachheda says:

    Thanks A Lot for This Post, I Really Needed This!!

  18. Toufiq says:

    I have done it! and obviously it works, but the problem is i have started to get crawl errors on google webmaster with 500 response, any help in this issue?

  19. languageweb says:

    worked a dream. Thanks!

  20. Olivia says:

    This question might be weird :) but i actually have this perfectly working with your few lines of code in the functions.php – means RSS is disabled. Now i want to enable RSS again – and i thought i just delete the lines and upload functions.php and that’s it – but RSS feed seems still to be disabled. Any ideas what i did wrong? thanks heaps!

  21. Kelly says:

    Thanks for this tip. Does it still work with wordress 3.0? I just tried it and got some error messages. Perhaps I didn’t place the function on the right line of the theme functions.php?


    • Editorial Staff says:

      It should still work with 3.0. Make sure that code is placed within the php tags and is not in another function.

  22. Renato says:

    Wow. You saved my life twice today!
    Thanks again!

  23. sherwinraavi says:

    What if I’m using wordpress as a cms but with a blog component? Can you turn on RSS for the blog but turn it off for the rest of the site?

    • Editorial Staff says:

      Don’t know how that would be possible unless you are running two separate installs of WordPress. Because all you have different if you are using as a CMS is pages and your pages do not show up in RSS anyways.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.