Exclude posts of a single category from main listing of your wordpress blog

  1. Goto your Blog Admin and then goto Categories under Posts.
  2. Click on the Category you want to exclude and then note the Category ID number. You can see the number in the picture below that is shown at the end of the URL in the address below. In my case it was category id 27 which I had to exclude.
  3. Goto your WordPress Blog Admin and then goto Editor under Appearance.
  4. Open the file “index.php” from right column and find the line “<?php if (have_posts()) : ?>”
  5. Just before that line add following code:
  6. <?php if (is_home()) { query_posts($query_string . "cat=-27"); } ?>

  7. Save the file and you are done.

Congratulations if you have followed till here. This might not be your first WordPress hack or you might have already done the same thing probably using some other method or may be plugin, or you might have learned something new in this short hackorial. Let me know you