Back to Community

How to Control or Remove Featured Images in GeneratePress

33 threads Sep 16, 2025 ThemeGeneratepress

Content

A common point of confusion for many users of the GeneratePress theme is the automatic display of featured images at the top of pages. This behavior often clashes with page builders like Elementor, where you might be designing a custom hero section, resulting in a duplicate image. Based on community discussions, this article explains why this happens and provides the most effective solutions.

Why Does This Happen?

This is not a bug but a default feature of the GeneratePress theme. For certain page templates, the theme is designed to automatically display the assigned featured image in a page header area. This is intended to provide a consistent and quick way to add a banner image to posts and pages. The conflict arises when users employ a page builder to manually create a header in the same location, leading to two images stacking on top of each other.

How to Remove the Automatic Featured Image

There are a few reliable methods to prevent the theme from displaying the featured image. The best method for you depends on your comfort level with code and your specific setup.

Method 1: Using a Simple PHP Snippet (Recommended)

The most common and effective solution is to add a small piece of code to your website. This code specifically targets the function that outputs the featured page header and removes it.

add_action('wp', function() {
    remove_action( 'generate_after_header', 'generate_featured_page_header', 10 );
});

How to add this code: You should install a dedicated "Code Snippets" plugin (like the one aptly named 'Code Snippets') to safely add this PHP code to your site. Avoid adding it directly to your theme's `functions.php` file, especially if it's not a child theme, as your changes will be lost when the theme updates.

Method 2: Checking Your Page Template

Before adding code, check the template assigned to your page in the WordPress editor. Sometimes, selecting a different template (like "Elementor Full Width" or "No Header") can control the display of certain theme elements, including the featured image header. The availability of these templates can vary.

Method 3: Using Custom CSS (For Specific Cases)

If you only need to hide the image visually (it will still load in the background), you can use CSS. Inspect the element on your page to find its exact class or ID, then use code similar to the following in Appearance > Customize > Additional CSS:

.page-header-image {
    display: none;
}

Troubleshooting Other Image Issues

The sample threads reveal other related image issues:

  • Image Sizes: GeneratePress uses the 'full' image size for its page header by default. To change this, you would need to use the `generate_page_header_default_size` filter in your child theme's `functions.php` file.
  • Image Clickability: If images in a post grid are not linked, this is typically controlled in the block or widget settings (e.g., the WordPress Query Loop block or a page builder widget) where you can set the link to the single post.
  • Spacing Between Images: To add space between images without adding manual line breaks, you can use custom CSS like .entry-content .wp-block-image { margin-bottom: 30px; }.

Important Considerations

It's important to distinguish between issues related to the free GeneratePress theme and those that require GeneratePress Premium. For example, creating a "Page Hero" with the Elements module is a feature of the Premium plugin. Similarly, advanced background image controls are part of the Premium offering. For issues with third-party plugins like Elementor, it's often best to also consult that plugin's support resources, as the theme and page builder can interact in complex ways.

By understanding how the theme handles featured images and using the correct method to control them, you can achieve the desired layout without conflict.

Related Support Threads Support