Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Drupal tricks: Removing the RSS icon in Drupal (and getting to know Views a little bit)

hether RSS has a future or not is debateable, but I often find myself removing the standard RSS icon in Drupal, sometimes for good or sometimes for just placing a nicer version of the classic icon somewhere else in my theme, linked to the RSS feed.

In Drupal, like with so many other things, there are several ways of removing the RSS icon in the theme. I'm going to show you the way that I have found to be the easiest and the way that also sticks when you're trying out, or switching to a new theme.

Sure, you can remove the icon in the theme you're putting together, or you can hide it with CSS (don't do that, that weakens your SEO ranking) so the way I'm going to show you is within the system, within the awesome thing that is Views.

What... Views?

For those who don't know it, Views is a module in Drupal (up until version 7 of Drupal it was a stand-alone module, but from version 8 it's part of Drupal and makes every listing a view, which is awesome!). Views can be described as a "point and click interface to ask simple or complicated questions about the content of the website", or "a graphic way to get content in listings (or just one result) from the database". Whatever you want to use Views for, it's highly competent and when you get to know the way Views in Drupal works, it's only your imagination that set the limits of what you can do with the content after that.

Every listing you see in Drupal, both the listings for the editor and the listings that visitors can see and visit, are powered by Views. And you are able to edit all of these, able to bend them to your pleasing.

With that said, let's dig into Views and make a teeny, tiny change that'll remove our RSS icon.

Structure -> Views

Log in to your website, navigate to Structure and then Views. The image below shows the way (the dropdown menu is not native to Drupal, it's an add-on module (or plugin if you will) called Admin Toolbar.

Behold! Views!

When accessing Views for the first time, it's kind of boring. It's only a listing of different Views that you know nothing about.

Well... See this as a "beginning of a beautiful friendship".

Different displays in Views

Another thing you need to grasp before heading into the interface of Views is "displays".

You can have as many Views as you want, but it's common and recommended that you collect them and sort them depending on what the views are for. 

For example. If you want to have three content listings - perhaps landing pages - showing the articles you have written but you want to sort them differently or want to show different version of the content depending on the situation. In the first listing you want to show everything - preamble, the article itself, images and a description of you as an author. The second listing should only include a small version of the article image and the preamble - to tease your readers. And the third listing should only include the title and the date of when the post was published. Since all these three listings handles the same content in some way, it recommended that you create one View, and have three different displays in that View.

There are many different displays in Views - and you can add and create your own - but this article will only mention them.

Let's dig in!

Time to do the thing we're here for. Time to edit a view! And not only a view - one of the displays of a view!

Start by finding the View called Frontpage and then click Edit to start editing the View we want to change.

What you see next can be a bit much, but don't worry, we won't go into the depths that are Views, we are just going to do some clicking around, uncheck a checkbox and save the view to accomplish what we are here for.

What we are editing now is the list of content that are shown on the frontpage of Drupal, and the feed icon is there because there is another Display in this View.

Remember, you are recommended to use one View for similar content and here is another great example: content shown to visitors and a RSS feed, shown also to users, but with a RSS Reader of some kind. Same content - shown in two different ways.

This View has two displays: Page (the one that are used as frontpage) and Feed (the RSS feed). The RSS feed is represented by the icon and are attached to the Page display. In other words, whereever the Page is shown, the feed tags along like an annoying little sister or brother.

Ok, let's remove the RSS icon now already!

Yes, time to operate! We are going to edit the second display, the Feed, and detach that one from the first display, the Page.

To do that, click the display for the Feed.

Then, in the middle column, find Feed Settings

Next to Attch to:, click Page.

Uncheck the Display called Page.

Click Apply.

End this by clicking Save, to save the View and make your changes take action on your website.

And, voilà, when you visit the frontpage of your website, the icon is gone!

Think of this as hidden in plain sight

Even if the icon is gone, the feed is still active and can be accessed via the URL /rss.xml. If you want to remove the feed, you need to deactivate the Feed display in the View called Frontpage.

Another way to make the feed more difficult to find is to change the URL to the feed, set your own path to it.

Under Feed settings in the middle column of the View, click the /rss.xml path to change it to whatever you want. Don't forget to Save the view after you've changed something.

"But wait, there's more..."

Yes. There is one other thing to remember. Well, there are many other thigs, but Drupal also generates RSS icons to taxonomy feeds as well. Taxonomy is the name for terms, tags, categories, and these are displayed by default in Drupal.

The taxonomy listing is structured in the same way as the Frontpage, with two displays where the Feed is attached to the Page. So to remove the RSS icon from the feed of taxonomy terms all you need to do is to repeat the process shown above but within the View called Taxonomy term.

That's it!

That's my way of removing that pesky RSS Icon. Hope you have enjoyed the guide. Please feel free to read some of my other guides and walk-throughs in Drupal.

TL;DR;

For those who already know Drupal: Detatch the Feed display from the Frontpage Page display in Views. Repeat with Taxonomy Term if you want to remove the RSS Icon from that listing as well.

Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web