How To Exclude A Category From RSS Feed in WordPress:
You just need to add this code to your WP theme functions.php file:
<?php
function myFeedExcluder($query) {
if ($query->is_feed) {
$query->set('cat','-5');
}
return $query;
}
add_filter('pre_get_posts','myFeedExcluder');
?>
In the above example -
-5
is the category ID I might want to exclude. :) – Pretty simple as it turned out.
We’ve built a subscription base of over 14,000 RSS subscribers with an interest in seo who expect a certain type of post to a particular schedule as a newsletter – but I also wanted the control of publishing posts that wouldn’t necessarily fit in with the normal seo related tips, and wouldn’t deluge my current subscribers with content they might not really want.
SO I wanted to be able to exclude a particular category from my RSS feed so I could publish more wordpress, web development and seo news type posts (like this one). :)
I can always do the odd round up post to let my subscribers know about this other content.
It could actually give me much greater control – perhaps if I publish something that’s popular, I can then have the option to promote to subscribers. Either way it’s more spider food for engines.
If it works.
RELATED ARTICLES
- The Best WordPress SEO Plugin
- Advice – Nofollow Blog Comments
- Do WordPress Self Pings Waste Pagerank?
- Host WordPress blog in a subdomain or directory?
- How To Exclude A Category or Post From RSS Feed in WordPress
- List Recent Posts From Single Category on Posts Within Same Category
- Add Text To Home Page Only on WordPress Blog
- WordPress Contact Form 7 Redirect To Thank You Page
- Speed Up Contact Form 7 Plugin For WordPress
- Dynamic PHP Copyright Notice in WordPress
- How To Import Large WordPress XML File Above Default Limit Size




Not to make your beautiful WP snippet more complicated, but how do I subscribe to your snippet posts? I’m really, really into WP, Accessibility, web design, etc etc! A direct link to the category feed would be: ….example.com/category/post-url/feed I can’t find a list of your categories on your site. If you add a feed link to this post, We can subscribe to your snippets.