Jean is an Internet and Multimedia specialist with a keen interest in music, technology, business, sports and psychology.
Jean Galea
Internet Consultant in Malta
Jean Galea: entrepreneur and internet specialist. Holding an M.Sc. in Multimedia & Internet Computing from Loughborough University, Jean specialises in web design and development, email marketing systems and general internet consultancy.
Filter for excluding certain categories in WordPress
Put this code in the Functions.php file:
// filter for exluding certain categories
function myFeedExcluder($query) {
if ($query->is_feed) {
$query->set('cat','-12');
}
return $query;
}
add_filter('pre_get_posts','myFeedExcluder');
This will exclude category 12 from your RSS feeds. If you want to exclude more than one category, put them in separated by commas ‘-12,-25,-33′.
Related posts:
- Collection of Useful WordPress Functions
- Easy Styling of TinyMCE Editor in WordPress 3
- Duplicating Pages/Posts quickly in WordPress
- The Ultimate WordPress Thumbnail Hack
- Use WordPress functions outside of WordPress
Leave a Reply
Thank you for reading this blog. Please check back for new posts.

