Add RSS Feed To Nuxt3 App

In this tutorial we're going to create an RSS feed to use with Nuxt3 and Nuxt/Content module.

First we're going to install the RSS package into our application.

yarn add --dev rss

In Nuxt3 there is a feature to create Server Routes we're going to use this to create our RSS feed route.

Create a new files in server/routes/feed/rss.xml.ts

In this file we need to fetch the latest articles and output them in RSS feed format.

import { serverQueryContent } from '#content/server'
import RSS from 'rss'

export default defineEventHandler(async (event) => {
    const docs = await serverQueryContent(event).sort({ createdAt: -1 }).limit(100).find()
    const blogPosts = docs.filter((doc) => doc?._path?.includes('/articles'))

    const feed = new RSS({
        title: 'Paulund',
        site_url: '',
        feed_url: ``,

    for (const doc of blogPosts) {
            title: doc.title ?? '-',
            url: `${doc._path}`,
            guid: `${doc._path}`,
            date: doc.createdAt,
            description: doc.description,

    const feedString = feed.xml({ indent: true })
    event.res.setHeader('content-type', 'text/xml')


Reliable uptime monitoring and instant alerts for any website downtime.

  • Uptime Monitoring
  • Performance Monitoring
  • SSL Certificate Alerts
  • Domain Monitoring
  • DNS Checker
  • XML Sitemap Monitoring