All of the sudden, we are experiencing problems with our RSS feed which comes with the Drupal core 7.x . It is no longer valid due to two spaces before the opening XML tag. The following error is what I get in the feed validator:
line 1, column 2: XML parsing error: <unknown>:1:2: XML or text declaration not at start of entity
So I am aware of other related posts on Stack Exchange and tried the things mentioned in:
- Approach to removing extra space at beginning of RSS file?
- xml sitemap module : XML declaration allowed only at the start of the document [closed]
- RSS Feed does not validate using Views RSS module
These are the things we did do so far:
- Checked all PHP-files on the website for containing blank spaces before the opening tags. There were a few, we fixed them all but no help.
- Changed the default theme to another theme, making sure it is not theme related.
- When I create a custom RSS feed with Views, the same two blank spaces show up before the XML opening tag.
- I checked every page, block and view that has manually written PHP tags everywhere and deleted every space that could cause this.
- All modules and Drupal core is updated to the most recent versions.
- I checked on the Drupal forum for related issues in XML Sitemap, Metatag, RDF, Schema.org (modules we are using) with no success. I disabled every one of the above mentioned modules one by one, but with no success.
- Eventually we exported the complete website, except the sites/default/files/ folder which contains no PHP files anyway, and imported it local. The blank spaces are gone in the local setup.
What makes it a bit difficult too, is that I have no idea when the RSS feed went broken. It can be between a week and a few months, making it difficult to filter out when I updated some contrib modules.
So we are quite desperate in finding this, especially since the problem doesn’t exist in a local setup. We have a news website so having a working RSS feed is pretty important.
We must be overlooking something, but have no idea what it can be.