If you are using the WordPress platform for your blog and want to exclude the posts of some certain categories then this article may sound well.There are too many ways that help to exclude the posts of a certain category. But I’ll discuss the most appropriate ways that works generally. One important thing you should remember that never try it in hurry. Follow every thing carefully I discussed ( read also : How To Install Your WordPress Blog In Wamp Server). Always take a backup of all of your theme templates before editing them because if you mess up then you can restore the back up.
1.Exclude the post of a certain category by editing the template
You can exclude the post of any category using Query_posts function.For example let us say that you want to exclude the posts from the category with category ID 4. Just open the template named index.php from the theme folder and look for the line
< ?php if (have_posts()) : ?>
Now add this before the line mentioned above.
<?php query_posts($query_string . “&cat=-4″); ?>
By the above process you can exclude undesired category posts from your home page.
To know the category ID just hover the mouse pointer on the Category name in the category list in your WordPress dashboard,the id will appear in the status bar.
There is one back draw of this process.If a post is published under multiple categories then the post will be still visible in the home page.You can avoid this if you post the article which you want to exclude from home page in just one category.
2.Exclude the post of a certain category using WordPress plugin
There is a smart WordPress plugin that allows you to exclude posts from a certain category.
- Download the Front Page Excluded Categories plugin and upload it in the plugin folder under wp-content.
- Now activate it from the WordPress Dashboard.
- Open the plugin Editor and Select the “FrontPage excluded Categories” for Editing.Find for the line
$cats_to_exclude
Now include the category ID of which you want to exclude the posts from appearing in the home page.
Now you have done.
Tell us which process you prefer to use. Feel free to share with us.


Wow! What a useful post. I think i will bookmark your website and come back for further refrence. keep up the good work tanmay. I was thinking whether i could remove some categories from the homepage but never really was able to do that.
thanks again…. you helped a lot !
Thank you Sarah for your good words and happy to help you.I also refer you to subscribe the RSS feed and Email news-letter.so that you can be updated with us.Keep coming.
Very useful post. I am gonna use it in my blog. thanks a lot for sharing it. I would prefer to use second method.
@Abhishek: Yes, you can use the second method as this is about to use a plug-in. But I, personally prefer to use the first method as it does not require any plug-in. Plug-ins always decrease the performance of your blog. Any way thanks for your comment.
Thanks very much for this. I t is just what I was looking for the home page of my site. Much appreciated.
I 100% agree with your way of thinking. Everything makes sense now, thanks a lot.
nice