Exclude specific keywords from Blogspot RSS feed

I've posted before about taking more advantage of Blogger's provided RSS feeds to help you get content at a more granular level. But real quick, I wanted to show a good way of following Blogger blogs via RSS that gives you a nice level of filtering of posts. 

We can use common AND, OR, NOT syntax in Blogger searches, and turns out they can apply to RSS feeds too. 




Usually, I have a set of keyword terms that I know I am not interested in at all. Usually politics stuff. But whatever your case, try this:

First, use the normal Blogger search to sift out posts you don't want using syntax like this:


https://sample.blogspot.com/search?by-date=true&q=-term1+-term2+-term3+-term4 


Once you're satisfied, turn it into an RSS feed pretty simply [UPDATE: fixed a dumb typo; thank you to Panda Mery for pointing it out]:


https://sample.blogspot.com/feeds/posts/default?by-date=true&q=-term1+-term2+-term3+-term4


We add the ?by-date=true argument because otherwise, the results come back just like a normal Blogger search would return them: by relevancy. But if you're following via RSS, we can safely assume you want recency, not relevancy. 

Use this trick to help filter the junk from a Blogspot blog. 

https://www.yourblogname.blogspot.com/feeds/posts/default?q=KEYWORD/feeds/posts/default?

HT to Too Clever By Half for this idea. 

Comments

Adam said…
Hi Sam, this is very cool, and kudos for figuring it out. Have you found environments beyond the url that can use these boolean feeds?

I'm finding that they don't validate and at least some feed readers don't like them. Is there more to know, to make them more useable?
Sam Nordberg said…
Not sure. I just experiment around. Sometimes using the minus sign works better, sometimes converting the punctuation to percentage-encodings works better. I got the method I described in the post working in my feed reader so I just went with it.