Sometimes you might need to exclude certain posts from Home/Front page.This post will help you to do that in Genesis Framework.

1. Create a category and assign the posts to that category.

2. Now go to Posts >> Categories and Edit the category you just created.

3. In URL field of your browser.Note down the category ID.


Here is a code you will be using

/** Exclude certain category from posts */
add_action( 'pre_get_posts', 'be_exclude_category_from_blog' );
function be_exclude_category_from_blog( $query ) {

    if( $query->is_main_query() && $query->is_home() ) {
        $query->set( 'cat', '-156' );

In the line

$query->set( 'cat', '-156' );

Replace 156 with the category ID you noted down from step 3.(Do not remove the negative sign)

if you want to exclude more than one category then separate each ID with comma.For example

$query->set( 'cat', '-156,-2' );

Paste the modified code in your child themes functions.php and clear the cache.Now check the Home page.

If you forget the negative sign in front of the Category ID then the homepage will only display posts from the category you mentioned.

Excluding Category from Blog Page Template

In Genesis you can create a blog page by using Blog page template.Incase you want to exclude category from Blog page then from WordPress Dashboard go to Genesis Settings Page.

Under the Blog Page Template option you can find a field called Exclude the following Category IDs.Paste the category ID you want to exclude.Use comma to separate the category ID if you want to exclude more than one categories.


Hope this tutorial helped you,Please share your thoughts about this post.


  1. says

    Yes thanks Vivek, this was very helpful. One question I have is about the Blog page.

    Is it best practice to create a Blog page from the Blog template, or is it better to simply add the Blog Category to the menu?

    Both methods appear to do the same thing.

  2. says

    Hi – Thanks for the tutorial! I tried the second option by adding the category ID to the exclude list in the Genesis theme settings, but for some reason it is still including posts from that ID. Any suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge