Fixing the Invisible RSS Metadata Mistake in Hugo
RSS feeds are supposed to be simple. But when your site’s metadata quietly misleads crawlers—or omits the feed link entirely—it can take a while to notice. That’s exactly what happened to me while preparing for Blaugust 2025. My RSS feed was working fine for human visitors, but invisible to feed readers or crawlers. Here’s how I discovered the issue and fixed it.
The Problem
I had a working RSS feed at mydomain/rss.xml, and even added a visible RSS button on my homepage. But in the Blaugust 2025 OPMLfile, my feed was incorrectly listed as mydomain/%20index.xml.
After some digging, I realized the culprit was a malformed <link> tag in my site’s <head> section:
<link href="/ index.xml" rel="alternate" type="application/rss+xml">
That stray %20 (a space character) was breaking automatic feed discovery.
Why It Matters
Most RSS readers and crawlers don’t click buttons—they scan metadata. Tools like:
- Inoreader
- Feedly
- Browser RSS extensions
- Blog aggregators
…rely on the <link rel="alternate" type="application/rss+xml"> tag in your HTML <head> to find your feed. If that tag is wrong or missing, your feed won’t be picked up—even if it’s working perfectly.
The Fix in Hugo
My site uses Hugo, and the issue came from the head.html partial. Here’s the problematic snippet I had:
<link href="{{ " index.xml" | relURL }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
Notice the space before "index.xml"—that’s what caused %20index.xml in the output.
Updated Code
Since my feed is actually rss.xml, I replaced it with:
<link href="{{ "rss.xml" | relURL }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
This ensures the correct metadata is generated and crawlers can find the feed.
Final Check
After updating the template, I verified the fix using:
- View Page Source: Confirmed the correct
<link>tag. - Feed Validator: W3C Feed Validator
- Manual test in Feedly/Inoreader: Feed was successfully discovered.
Takeaway
If you ever change your RSS feed filename or location, don’t forget to update the invisible metadata in your <head> tag. It’s easy to overlook—but crucial for discoverability.