Do you want to exclude specific categories from RSS feed on your WordPress site?
If you have content that you don’t want to appear in your main RSS feed, you can create specific categories to prevent them from showing up. They will still be on your site, but they won’t be pushed out through RSS.
In this article, we will show you how to exclude specific categories from your WordPress site’s RSS feed.
Why Exclude Specific Categories from Your RSS Feed?
All WordPress blogs have an RSS feed that updates when you publish a new post. By default, these display content from every category on the site in the order it’s published.
There could be any number of reasons you might want to exclude certain categories from that RSS feed. Maybe you run a site where you categorize posts for specific courses and don’t want those lumped in with more general blog posts.
Perhaps you don’t want News posts going out into your RSS feed over Features posts, or maybe your email list is connected to RSS and you publish a lot and don’t want to overwhelm your subscribers.
Whatever the reason, we can show you how to exclude specific categories from your WordPress RSS feed. In this tutorial, we will be doing this in two ways:
Method 1: Exclude Specific Categories from WordPress RSS Feed with WPCode
This method requires you to add code snippets to your WordPress theme’s functions.php file. Normally, we only recommend directly editing your own WordPress files if you’re an advanced user because even small mistakes can easily break your site.
For this tutorial, we will be using WPCode, the easiest and safest way for anyone to add code snippets without fear of breaking WordPress.
Upon activation, you can simply head to Code Snippets » Add Snippet and search for ‘rss.’ This will find a pre-configured snippet titled ‘Exclude Specific Categories from RSS Feed’ in the WPCode library.
Note that you can also find other snippets in the library that may replace any number of dedicated, single-use plugins you have on your site.
Hover over it with your mouse and click the ‘Use Snippet’ button.
Next, you will see the ‘Edit Snippet’ page, where WPCode has already set up all the options you need to run the snippet.
All you have to do is replace the category IDs with the IDs of the categories that you want to exclude. For more information, you may want to see our guide on how to find category IDs in WordPress.
To exclude multiple categories, you can use a comma-separated list. You can see this on Lines 3 and 11 in the image below.
Once you’ve chosen the categories to exclude from your WordPress RSS feed, toggle the switch to ‘Active’ and click on the ‘Update’ button.
Your chosen categories will now be excluded from your WordPress website‘s RSS feed.
If you want to include them in your RSS feed again, simply toggle the switch to ‘Inactive’ or remove the category ID from the snippet itself and then update the page.
Method 2: Exclude Specific Categories from RSS Using a Dedicated Plugin
For this method, we’re going to use the dedicated plugin, Ultimate Category Excluder.
The first thing you need to do is install and activate the plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit Settings » Category Exclusion to configure plugin settings.
The settings page will display all categories on your WordPress blog with options to hide them from the front page, RSS feeds, archive pages, and search results.
Simply check the box for the category in the ‘Exclude from Feeds?’ column to exclude it from your RSS feed. Don’t forget to click on the ‘Update’ button to save your settings.
That’s all, posts filed under your selected categories will disappear from your WordPress RSS feed.
We hope this article helped you learn how to exclude specific categories from your WordPress RSS feed. You may also want to see our list of the 6 best drag-and-drop page builders for WordPress or how to allow file uploads on your WordPress site.