Back to Community

How to Control Which Posts Appear on Your GeneratePress Homepage

14 threads Sep 10, 2025 ThemeGeneratepress

Content

Many WordPress users choose to set their homepage to display their latest blog posts. However, a common challenge arises when you want more control over this automatic list. Perhaps you want to exclude posts from a specific category, change their display order, or even hand-pick which posts appear. This guide will walk you through the most common methods for taking control of your GeneratePress homepage content.

The Core Issue: Understanding the "Latest Posts" Homepage

By default, when you set your homepage to "Your latest posts" in Settings > Reading, WordPress uses a main query to pull in your most recent published posts. The GeneratePress theme outputs this query using its standard archive template. The limitation is that this default WordPress behavior offers few built-in options for filtering or reordering these posts directly from the admin area.

Common Solutions for Customizing Your Homepage Posts

1. Exclude Posts from Specific Categories

If your goal is to hide posts from a certain category on the homepage while still using the "Latest posts" setting, you can use a small PHP code snippet. This method modifies the main query before it runs.

Step-by-Step Guide:

  1. Identify the ID of the category you want to exclude. You can find this by going to Posts > Categories and clicking on the desired category. The ID will be in the URL of the browser (e.g., tag_ID=5).
  2. Install a code snippets plugin (like "Code Snippets") to safely add custom code to your site.
  3. Create a new snippet and paste the following code, replacing -22 with your actual category ID (use a negative number to exclude it):
function exclude_category_homepage( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
        $query->set( 'cat', '-22' );
    }
}
add_action( 'pre_get_posts', 'exclude_category_homepage' );
  1. Save and activate the snippet. Posts from the specified category will no longer appear on your homepage.

Note: Always test code on a staging site first and ensure you have backups.

2. Create a Static Homepage with a Custom Query (Advanced Layouts)

For maximum control—including choosing specific posts, creating complex layouts, or ordering posts manually—the most flexible solution is to create a static page for your homepage. You can then use a page builder or blocks to design it.

How to do it:

  1. Go to Settings > Reading and select "A static page" for your homepage.
  2. Create a new page (e.g., "Home") and set it as your homepage.
  3. Use a block plugin that includes a Query Loop or Posts block. The free GenerateBlocks plugin is a popular choice that works seamlessly with GeneratePress. Its Query Loop block allows you to select which categories to include, set the order, and customize the layout.
  4. Design your homepage using these blocks. This approach allows for side-by-side articles, grids, and other layouts that are not possible with the default blog roll.

3. Remove the Blog Posts Entirely

If you no longer want any blog posts on your homepage, the simplest solution is to switch to a static page and simply not add any post loops to it. You can use this page for a welcome message, promotional content, or anything else.

What About Premium Features?

It's worth noting that some highly specific layouts, like those found in the "Scribe" or "Info" templates from the GeneratePress Site Library, rely on the premium plugin's "Elements" and "Blocks" functionality. These features provide advanced hooks and templates for creating dynamic content. However, the methods described above using GenerateBlocks and static pages are powerful and entirely achievable with the free version of GeneratePress.

Conclusion

While the default "Latest posts" homepage in WordPress is convenient, it's not always the most flexible. By using a simple code snippet to exclude categories or, for more advanced control, creating a static page with a query loop block, you can fully customize which posts appear on your GeneratePress homepage and how they are presented.

Related Support Threads Support