I am trying to generate an RSS feed, but it does not validate. I googled around and found RSS Feed does not validate using Views RSS module, but unfortunately it's for Drupal 7, while I am using Drupal 8.4.4.

What a similar method for Drupal 8 would be? The XML I get has an empty line before <?xml version="1.0" encoding="utf-8"?>, which I believe it's the main problem.

<?xml version="1.0" encoding="utf-8"?>
  <rss version="2.0" xml:base="https://example.com/feeds.xml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

        <title>UAE Lenders Upbeat as Growth Prospects Surge</title>
        <description>  &lt;img src=&quot;/sites/default/files/styles/large/public/Article/growth-prospects-surge-in-uae.jpg?itok=VEwWB-9R&quot; width=&quot;480&quot; height=&quot;320&quot; alt=&quot;&quot; typeof=&quot;Image&quot; class=&quot;image-style-large&quot; /&gt;

1 Answer 1


Do you have a template for views-view-rss.html.twig in your theme folder? Try enabling the Twig debug feature if you are not sure.

The default one in core/modules/views/templates works properly (same core version).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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