Disable RSS for one (or more) specific posts in a blog

Adding the outputs array to the front matter of a single page won’t help. That just tells Hugo which output formats to render for that page.

You want to exclude one or more pages from the page collection.

The easiest thing to do is piggy back off of the sitemap settings, which makes sense because if you don’t want an item in an RSS feed then you probably don’t want it in the sitemap either.

+++
title = 'Post 1'
date = 2025-01-03T21:15:07-08:00
draft = false
[sitemap]
disable = true
+++

Then create a new, empty file:

mkdir -p layouts/_default
touch layouts/_default/rss.xml

Then copy the source of the embedded rss template into the file you just created.

Finally, change this:

{{- range $pages }}

To this:

{{- range where $pages "Sitemap.Disable" "ne" true }}
2 Likes