How to Exclude Category Posts from your Wordpress Homepage

I recently updated my template for my blog (thank you Joern Kretzschmar) and started using Wordpress’ bookmarklet feature to post quick news from sites I like to visit. I didn’t want these bookmarklet posts to show up on my homepage and here is a really simple way to accomplish it. If you’re not technical, don’t worry, it’s really simple.

Here’s how to do it:

1) Edit the index.php file in your theme folder (or edit it from Presentation -> Themes)
2) find the category ID of the category you want to exclude from Manage -> Categories
3) crack open index.php in the root of your theme folder.
4) About 20 lines down there is some code:

<?php while (have_posts()) : the_post(); ?>

change it to this:

<?php while (have_posts()) : the_post(); if (is_home()) if (in_category(’YOUR-CATEGORY-ID’)) continue; ?>

Props to Blogulate for the tip.

Related posts:

  1. How to manually change your Wordpress theme
  2. How to show empty categories in Wordpress using the default category widget
  3. Post from Wordpress to Facebook
  4. How to Show Empty Categories in Wordpress 2.7


9 Responses to “How to Exclude Category Posts from your Wordpress Homepage”

Leave a Reply