3 Ways To Exclude Categories From RSS Feeds In WordPress
Why Exclude Categories From RSS Feeds?
We have different reasons for wanting to exclude categories from RSS feeds in WordPress. I exclude categories from my RSS feeds because my blog is a niche blog about the plant based diet and sometimes I want to share blog articles that are outside my niche. Most people who sign up for my blog feed are mainly interested about articles within my niche. I am a web developer by trade I am sometimes like to share “how to articles” mostly dealing with WordPress issues, and I choose to exclude categories from RSS feeds not related to my niche so I am not sending my niche followers articles they may not be interested in. There are several ways to exclude categories from RSS feeds in WordPress and I use this one:
Exclude Categories From RSS Feeds In Your Functions.php File
You should attempt this only if you are comfortable coding. Make a backup of your original file before you start. Copy the code below and paste it into your functions.php file to exclude categories from RSS feeds.
[raw][/raw]
This code will stop the category ID=”134″ from being placed in your RSS feeds. You must include the minus sign (-) before the category number to exclude categories from RSS feeds. To exclude multiple categories you need to separate the numbers with commas, ex. “-134,-16,-24,-89”. To find your category numbers in WordPress you need to log in to your WordPress back-end and click the “categories” link in the left menu. Then click on the category you want the ID number for. You will find the category ID number in the URL in the address bar.
Exclude Categories From RSS Feeds With A WordPress Plugin
You can exclude categories from RSS feeds with the Ultimate Category Excluder plugin from Michael Clark. This WordPress plugin that allows you to quickly and easily exclude categories from your front page, archives, and feeds. Just select which categories you want to be excluded, and UCE does all the work for you. You can exclude your “space” category from your feeds only, your archives only, your front page only, or from all three at the same time.
Exclude Single Posts From RSS Feeds With A WordPress Plugin
You can use the Stealth Publish plugin by Scott Reilly to exclude a single from RSS feeds. Your post will be published without notifying your RSS feeds about the publication. The plugin will also stop the excluded post from showing on the front page of your blog, and will stop pingbacks, trackbacks, and pings to update services such as pingomatic.com. You can control whether or not you want to stealth publish with a click of a button. Check the illustration:
Exclude Categories From RSS Feeds In The Feed URL
You can exclude categories directly in your feed URL. You find find the feed URL in the header.php file or the footer.php file of our WordPress theme. You can exclude any category by appending a query string to the feed URL, like this:
[raw]