Home | Store | Contact | Videos | Privacy Policy

How to hide a categories posts from wordpress RSS Feeds without using any plugin

1 Comment » | This post was viewed 13352 times.

Few days back i write a tutorial on how to hide a categories posts from Home page without using any plugin, in the series of that we are going to discuss a way to hide categories from rss feeds without using any plugins.

How to hide categories from WordPress Feeds

1.In your current theme(template) files, open functions.php

2.Copy the below mention code in your functions.php file

<?php
function my_cat_exclude($query) {
if ($query->is_feed) {
$query->set('cat','-ID1,-ID2,-ID3');
}
return $query;
}

add_filter('pre_get_posts','my_cat_exclude');
?>

add_filter(‘pre_get_posts’,'my_cat_exclude’);
?>

Where ID= your categories ID’s

Note: If  you don’t want to digg into code, use this awesome plugin named as Advanced Category Excluder which not only hides the posts from displaying on home page but can also hides the posts from search results, your RSS feed, your category, your recent post, and from web crawlers.

101wordpress.gif


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “How to hide a categories posts from wordpress RSS Feeds without using any plugin”

  1. How to hide a categories posts from #wordpress RSS Feeds without using any plugin http://bit.ly/RV6ia

Leave a Reply