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

I have a few posts in the blog that I do not want appearing in the RSS feed.
Adding outputs: html to the frontmatter of the post did not seem to help
I’ve been looking everywhere and trying since yesterday and nothing seems to help. Does Hugo support this and I just cannot find the right thing I need? Or do I need to be doing something else?

Thank you folks in advance.
P.S. I’m running Hugo v0.140.2 on Linux Mint 22 (Wilma)
hugo v0.140.2-aae02ca612a02e085c08366a9c9279f4abb39d94+extended linux/amd64 BuildDate=2024-12-30T15:01:53Z VendorInfo=gohugoio

Frontmatter for the post. Do I need to add anything here?

title: "Tpt"
date: 2025-01-04T09:58:40+05:30
categories: ["things-of-note"]
tags: []
summary:

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

Aah! so i should have looked one layer of abstraction upwards :slight_smile: (not the post, but the collection)

Thank you so much @jmooring! I overrode my theme’s rss.xml with your instructions and it worked like a charm!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.