How to connect your static site to RSS

Modern website builders like WordPress usually come with RSS, but static websites do not. This means that we have to manually add the RSS code to our website and, every time we make a new page that we want to be on the feed, we must update the feed.

  • Create a file called feed.xml in your root folder. This is your main RSS feed that ‘lists’ your posts.
  • Paste the following code into it and save:
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <atom:link href="https://yourwebsite.neocities.org/feed.xml" rel="self" type="application/rss+xml" /> <title>Your Website Title</title> <link>https://yourwebsite.neocities.org</link> <description>Your website description</description> <language>en-us</language> </channel> </rss>
Code language: HTML, XML (xml)

  • In the above code, replace the following values.
    • atom:link href (must point to your .xml file)
    • <title> tag
    • <link> tag
    • <description> tag
    • <language> tag
  • Go to the page you would like to add to your RSS and edit.
  • Add this between your <head></head> tags:
<link rel="alternate" type="application/rss+xml" href="/feed.xml" title="RSS">
Code language: HTML, XML (xml)
  • Go back to feed.xml
  • Add this before the closing </channel> tag:
<item> <title>My Page Title</title> <pubDate>Wed, 10 Nov 2021 15:52:00 EST</pubDate> <link>https://yourwebpage.neocities.org/page.html</link> <guid>https://yourwebpage.neocities.org/page.html</guid> <description>A description of the page.</description> </item>
Code language: HTML, XML (xml)
  • In the above code, replace the following values.
    • <title> tag
    • <pubDate> tag
    • <link> tag
    • <guid> tag
    • <description> tag

Your feed.xml file should look like this:

<?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <atom:link href="https://yourwebsite.neocities.org/feed.xml" rel="self" type="application/rss+xml" /> <title>Your Website Title</title> <link>https://yourwebsite.neocities.org</link> <description>Your website description</description> <language>en-us</language> <item> <title>My Page Title</title> <pubDate>Wed, 10 Nov 2021 15:52:00 EST</pubDate> <link>https://yourwebpage.neocities.org/page.html</link> <guid>https://yourwebpage.neocities.org/page.html</guid> <description>A description of the page.</description> </item> </channel> </rss>
Code language: HTML, XML (xml)

When you’re finished, validate your feed by pasting your feed.xml URL on this website – it will tell you if there are any errors found.



Hey, thanks for reading! If you have any questions, you can leave me a comment and I always try to reply.

If you have any suggestions on how I can improve this article, please let me know!

This website is not monetized in any way. It purely exists to help others on their web-building journey. However, if you have the means to donate toward my server costs, I have a ko-fi account where I accept tips.

Leave a Comment