How to Exclude a Category from the Home Page

This is the  most common customization requests for WordPress, “How do I prevent posts from a certain category from displaying on my home page?!”   As I have a categry about WordPress Powered Website “Showcase” and I want to omit from the post loop so that post related to this category will no display on my Home Page. But this post still will be appear in your content field. To eliminate from feed and from Hope page there is excellent WordPress plugin Stealth Publish.


The simplest way for including and excluding a Category post from Home page is to modify the query_posts function as follow:

Excluding a category from the home page

<?php if ( is_home() ) {
query_posts( ‘&cat=-4’ );
// your usual Loop can go here
Where 4= The required Category ID and that Id you can find in category section. Go to Category  click on Edit and in URL you can find Category ID as shown in the picture below.

In query_posts( ‘&cat=-4’ ), a dash (or minus sign, “-“) appearing before a parameter value signifies exclusion. Thus, here I wanted to exclude a  category number four, When this code is placed before my loop, posts in Showcase will not be displayed.

Showing Only One Category on the Home Page

The above solution was for my own problem, Perhaps instead of excluding a category, you want to show only one category. Than there is minor change in the query_posts, All you have to replace the dash (or minus sign, “-“) as follows:

Showing only one category
<?php if ( is_home() ) {
query_posts( ‘&cat=7’ );
// your usual Loop can go here

Be careful, and proofread your Loops!
If you are not familiar with coding than the best option is to use WordPress Plugins for that purpose.

WordPress Plugins for Excluding Category

1.  Stealth Publish

Prevent specified posts from being featured on the front page or in feeds. Beneficial in instances where you want to publish new content without any fanfare and just want the post added to archive and category pages and its own permalink page.

2. Simply Exclude

Provides an interface to selectively exclude/include categories, tags, authors and pages from the 4 actions used by WordPress.


3. Advanced Category Excluder

This plugin was born because there was a no other real alternative to enable content sparationd and some CMS like functionalities in WordPress. The main goal was, to enhance WordPress’s functionalities, to hide some unwanted categories, from defined parts of the blog.


4. Ultimate Category Excluder

This is a WordPress plugin that allows you to quickly and easily exclude categories from your front page, archives, and feeds. Just select which categories you want to be excluded, and UCE does all the work for you!


Other useful resources and Reference:

4 Ways To Exclude WordPress Category From RSS Feeds

Exclude Categories from Feed, Archives, Search, and Home page in WordPress

Category Hacks for WordPress Theme Designers


5 out of 5 stars based on 335 rating(s).
  • Nur

    I am a WordPress, Website Developer and Designer, creator @ WP Arena, Provide Free WordPress consultation and can help to install WordPress in a secure way to small businesses and bloggers.