Home | Contact | Videos | MediaZo

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

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 How to hide a categories posts from wordpress RSS Feeds without using any plugin


Honey Singh is Head of Operations & Strategic Planning at MediaZo & VP Social/Technology at #ArmDigital. He has an experience of 8 years in designing, ideating/operating digital/social marketing strategies for global brands. You can also catch him on Foursquare, Twitter, Facebook , Google+ & Instagram.

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


seven × = twenty eight