Filter posts out of RSS feed based on tag?
Is there a way to not include posts with a set tag in the RSS feed?
I do this on my RSS feed, it works the same way in any other template.
I wrap the
{{^tagged.apples}}
<item>
<title><![CDATA[ {{{title}}} ]]></title>
<link>{{{absoluteURL}}}</link>
<guid>{{{absoluteURL}}}</guid>
{{! RSS feeds need a RFC 822 date}}
<pubDate>{{#formatDate}}ddd, DD MMM YYYY HH:mm:ss ZZ{{/formatDate}}</pubDate>
<description><![CDATA[ {{#absoluteURLs}} {{{body}}} {{/absoluteURLs}} ]]></description>
</item>
{{/tagged.apples}}
-Ray
Answered 2 years ago · Edit answerWould it be possible to use a version of this technique to output a feed for just one tag?
Answered 2 years ago · Edit answerYes! To convert a feed which ignores posts tagged apples, to a feed which only shows posts tagged apples, use the example above but replace this:
{{^tagged.apples}}
With this:
{{#tagged.apples}}
There's more about sections and inverted sections in the docs.
Answered 2 years ago · Edit answerI'm using the above method to limit posts tagged with 'linkpost' in my RSS feed. I'd also like to limit posts tagged with 'meta', since those are internal site mechanics posts that I think aren't for broad consumption.
What's the proper syntax to have multiple tags in the. exclusion criteria vs. just the one?
Answered 10 months ago · Edit answerI found the nested tag syntax in an answer to another post question.
Answered 10 months ago · Edit answer