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?
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.
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:
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
Choices menu Disable Feed
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
).
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.
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.
/admin/config/services/rss-publishing
.