How to Remove or Hide Elements in GeneratePress: A Complete Troubleshooting Guide
Content
Many GeneratePress users encounter situations where they need to remove or hide specific elements from their website layout. Whether it's post titles, featured images, meta data, or navigation elements, this comprehensive guide covers the most effective methods to achieve a cleaner design.
Common Elements Users Want to Remove
Based on community discussions, these are the most frequently requested removals:
- Post titles and content titles
- Featured images from post headers
- Post meta data (dates, categories, tags, author information)
- Post navigation (previous/next buttons)
- Recent posts widgets
- Author boxes and footer entry meta
- White space and background elements
Two Main Approaches: CSS vs PHP
CSS Method (Visual Hiding)
CSS hiding is simpler but only removes elements visually - the HTML code remains in the page source, which means search engines can still see it.
Example for hiding featured images:
.featured-image {
display: none;
}
Example for hiding post meta data:
.entry-meta {
display: none;
}
Example for hiding tags:
.single-post span.tags-links {
display: none;
}
PHP Method (Complete Removal)
PHP snippets completely remove elements from the code, making them invisible to both users and search engines. This is the preferred method for SEO purposes.
Remove post navigation completely:
add_filter( 'generate_show_post_navigation', '__return_false' );
Remove featured image from single posts:
add_action( 'after_setup_theme', function() {
remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single', 10 );
} );
Remove footer meta items:
add_filter( 'generate_footer_entry_meta_items', function( $items ) {
return array_diff( $items, array( 'post-navigation' ) );
} );
Remove meta data from archive pages:
add_action( 'wp', function() {
if ( !is_single() ) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
}
} );
How to Add Custom Code to Your Site
For PHP snippets, you'll need to:
- Use a code snippets plugin (recommended for safety)
- Or add code to your child theme's functions.php file
For CSS code, navigate to Appearance → Customize → Additional CSS in your WordPress dashboard and paste the code there.
When GeneratePress Premium Might Be Needed
Some removal options are only available through the GeneratePress Premium plugin's visual controls, including:
- Disable Elements module for content titles
- Blog module for post navigation settings
- Advanced styling options for archive layouts
Troubleshooting Tips
- Always use a child theme when modifying PHP files
- Test code in a staging environment first
- Clear your cache after adding new code
- Use browser developer tools to identify correct CSS classes
- Check if elements are coming from plugins rather than the theme
Remember that some elements might require specific targeting for different page types (single posts, archives, pages). If you encounter issues, try more specific CSS selectors or consult the GeneratePress documentation for appropriate PHP hooks.
Related Support Threads Support
-
Any way to remove post navigation?https://wordpress.org/support/topic/any-way-to-remove-post-navigation/
-
GeneratePress – Date in Post Cannot be Removedhttps://wordpress.org/support/topic/generatepress-date-in-post-cannot-be-removed/
-
Move Leave a Comment above commentshttps://wordpress.org/support/topic/move-leave-a-comment-above-comments/
-
Removing blog featured image from customiser does not workhttps://wordpress.org/support/topic/removing-blog-featured-image-from-customiser-does-not-work/
-
White space on home page display before posthttps://wordpress.org/support/topic/white-space-on-home-page-display-before-post/
-
Customizing a specific post layouthttps://wordpress.org/support/topic/customizing-a-specific-post-layout/
-
[NSFW] I want to remove featured image from embed linkhttps://wordpress.org/support/topic/i-want-to-remove-featured-image-from-embed-link/
-
How to remove tags and categories under exerpt on homepagehttps://wordpress.org/support/topic/how-to-remove-tags-and-categories-under-exerept-on-homepage-2/
-
Remove #more-1234 from link to posthttps://wordpress.org/support/topic/remove-more-1234-from-link-to-post/
-
Remove recent postshttps://wordpress.org/support/topic/remove-recent-posts-3/
-
Remove Post Titles From Bottom Of Posthttps://wordpress.org/support/topic/remove-post-titles-from-bottom-of-post/
-
Remove Featured Image (free version)https://wordpress.org/support/topic/remove-featured-image-free-version/
-
disable the display of the featured imagehttps://wordpress.org/support/topic/disable-the-display-of-the-featured-image-2/
-
Generate press content titlehttps://wordpress.org/support/topic/generate-press-content-title/
-
HOW REMOVE RECENT PAGE GENERATE PRESShttps://wordpress.org/support/topic/how-remove-recent-page-generate-press/
-
How to edit post category path ?https://wordpress.org/support/topic/how-to-edit-post-category-path/
-
Website submit section offhttps://wordpress.org/support/topic/website-submit-section-off/
-
how can I delete the white parthttps://wordpress.org/support/topic/how-can-i-delete-the-white-part/
-
Removing unwanted content from pasting a link & associated summaryhttps://wordpress.org/support/topic/removing-unwanted-content-from-pasting-a-link-associated-summary/
-
Feature imagehttps://wordpress.org/support/topic/feature-image-53/
-
How to disable links to previous blog posts and category?https://wordpress.org/support/topic/how-to-disable-links-to-previous-blog-posts-and-category/
-
How to display a summary next to an image in the post listhttps://wordpress.org/support/topic/how-to-display-a-summary-next-to-an-image-in-the-post-list/
-
Remove “Edit your profile”https://wordpress.org/support/topic/remove-edit-your-profile/
-
How can I move featured image to under the post title or after first paragraphhttps://wordpress.org/support/topic/how-can-i-move-featured-image-to-under-the-post-title-or-after-first-paragraph/
-
Exclude category from last blog posthttps://wordpress.org/support/topic/exclude-category-from-last-blog-post/
-
hide widget on single posthttps://wordpress.org/support/topic/hide-widget-on-single-post/
-
Need Help Removing ‘Category’ Prefix from Archive Pages.https://wordpress.org/support/topic/need-help-removing-category-prefix-from-archive-pages/
-
commenthttps://wordpress.org/support/topic/commont/
-
[wp_show_posts name=”Header”]https://wordpress.org/support/topic/wp_show_posts-nameheader/
-
Move Featured Image after post contenthttps://wordpress.org/support/topic/move-featured-image-after-post-content/
-
Title of post showing in photo captionshttps://wordpress.org/support/topic/title-of-post-showing-in-photo-captions/
-
Remove Archives Title in Webstore pagehttps://wordpress.org/support/topic/remove-archives-title-in-webstore-page/
-
blog buttons when you open a posthttps://wordpress.org/support/topic/blog-buttons-when-you-open-a-post/
-
GP blog site customizationhttps://wordpress.org/support/topic/gp-content-page-customization/
-
How remove feature image from the top of the content?https://wordpress.org/support/topic/how-remove-feature-image-from-the-top-of-the-content/