Family Encyclopedia >> Electronics

How to Exclude Specific Categories from Your WordPress RSS Feed (2 Proven Methods)

Want to exclude certain categories from your WordPress RSS feed? Many site owners use specific categories for promotional or internal content that shouldn't appear in their public RSS feeds. As experienced WordPress developers, we've helped countless sites achieve cleaner feeds. Here's how to do it reliably.

How to Exclude Specific Categories from Your WordPress RSS Feed (2 Proven Methods)

Method 1: Exclude Categories Using a Plugin (Easiest for Beginners)

First, install and activate the Ultimate Category Excluder plugin. See our detailed guide on installing WordPress plugins if needed.

Head to Settings » Category Exclusion to configure it.

How to Exclude Specific Categories from Your WordPress RSS Feed (2 Proven Methods)

The settings page lists all your blog categories with checkboxes to hide them from the front page, RSS feeds, archives, and search. Check the Feed Exclusion box for categories you want to remove from RSS.

Click Update to save. Posts in those categories will now be excluded from your RSS feed.

Method 2: Manually Exclude Categories with Code (For Advanced Users)

This requires editing your theme's functions.php file or a site-specific plugin. Comfortable with code? Here's a battle-tested snippet:

function exclude_category( $query ) {
    if ( $query->is_feed() ) {
        $query->set( 'cat', '-5,-2,-3' );
    }
    return $query;
}
add_filter( 'pre_get_posts', 'exclude_category' );

This excludes categories with IDs 5, 2, and 3. Replace with your own IDs—check our guide to finding category IDs in WordPress.

For a single category (e.g., ID 15):

function exclude_category( $query ) {
    if ( $query->is_feed() ) {
        $query->set( 'cat', '-15' );
    }
    return $query;
}
add_filter( 'pre_get_posts', 'exclude_category' );

Replace -15 with your category ID. Always back up before editing files.

We hope this guide empowers you to customize your WordPress RSS feed. Explore our top 10 category hacks and plugins for more tips.

Subscribe to our WordPress YouTube channel for video tutorials. Follow us on Twitter and Facebook.