7

Is it possible to disable the RSS feed? I have a site that it isn't relevant for and just don't want it.

If it is not possible, how can I restrict what appears? How does Drupal choose what content appears in the feed?

3
  • is this for Drupal 7 or Drupal 8?
    – No Sssweat
    Commented Dec 2, 2015 at 10:39
  • Actually I need to know for both, but either would be good to know.
    – James
    Commented Dec 2, 2015 at 10:44
  • I turned mine off in D7, but I can't remember where. Perhaps you need to empty the Feed Description box in here /admin/config/services/rss-publishing.
    – No Sssweat
    Commented Dec 2, 2015 at 10:50

6 Answers 6

7
+50

Drupal 7

For D7 simply use Disable RSS.

This module will disable the core RSS feed at http://example.com/rss.xml, and remove any reference to it in the html header.


Drupal 8

In D8 the feed is provided by a view. Disabling it will disable the feed. Go to http://example.com/admin/structure/views/view/frontpage/edit/feed_1 and disable this display:

enter image description here enter image description here

1

Just disable the feeds' view on default taxonomy term view.

1

You disable in views {example.com}/admin/structure/views/view/frontpage/edit/feed_1 {example.com}/admin/structure/views/view/taxonomy_term/edit/feed_1 enter image description here

Choices menu Disable Feed

2
  • So the feed is generated in Views? And this stops the feed being generated? Commented Aug 14, 2018 at 9:28
  • feed had create in views, if you don't want it to show you can disable
    – vinhdv
    Commented Aug 14, 2018 at 9:46
0

Drupal 7

Just unset the menu entries related to RSS. This allows to disable not only the main rss.xml but also blog and taxonomy feeds.

In a module add a hook to alter the menu:

function yourmodule_menu_alter(&$items) {
  unset($items['rss.xml']);
  unset($items['blog/%user/feed']);
  unset($items['taxonomy/term/%taxonomy_term/feed']);
}

Remember to clear the caches after adding this code (e.g. drush cc all).

-1

You need to edit your page.tpl.php file and comment out or delete:

<?php print $feed_icons; ?>

Note: This will work only if no one has subscribed to the feed yet.

-2

In Drupal 8 the printing of feeds is called from the theme.
The core base theme "Stable" inserts a line at the bottom of the template core/themes/stable/templates/views/views-view.html.twig that looks like {{ feed_icons }}. Just delete it. I'm trying out the basetheme "fortytwo" which has its own template views-view.html.twig and the relevant section is also at the bottom but looks like

{% if feed_icons %}
   <div class="feed-icons">
    {{ feed_icons }}
   </div>
{% endif %}

so the section to delete may vary.

2
  • 2
    I suspect this will delete only the icons for the feeds, and the feed itself will still be available by typing the url
    – oksana-c
    Commented Feb 21, 2016 at 23:57
  • 2
    I want to stop the feed being generated, not just remove the icons.
    – James
    Commented Feb 22, 2016 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.