Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to exclude certain categories from the

Researching online I came across this code:

<a href="<?php bloginfo('url'); ?>/feed?cat=-3&cat=-12">Entries (RSS)</a>

Now the question is should I create a function (if yes what function to create) so I can exclude categories without having anyone to redirect to custom feed URLs

share|improve this question

2 Answers 2

Take a look on this plugin too Ultimate Category Excluder.i hope it'll helps you:)

share|improve this answer
Thanks for the tip. But I'm not a big fan of plugins anymore.. I already have around 30 plugins.. prefer to use php than plugins. – Sledge81 Jul 1 '11 at 8:06

In your functions.php add:

function excludeFeedCats($query) {
    if ($query->is_feed) {
        $query->set('cat','-3, -12');
return $query;


Or use Simply Exclude for more flexibility.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.