Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

LCP, FCP and custom post type template give me a headache.

  • Hello everyone in the team,

    I use GPP and ACF to create web pages. However, after testing, there are issues with LCP and FCP as shown in the screenshot, specifically on mobile devices. I’m not sure where to start fixing to achieve a score above 90++.

    Currently, I’m using Perfmatters and WP Fastest Cache as the main speed management tools.

    Please advise me. Thank you in advance.

  • Hai, did you try LiteSpeed Cache, for me LS Cache work perfect on GP, i also create some tutorial how to setting LS Cahce

    Thank you

  • Can you link us to the page?

  • The main issue is with the Single page. The structure is similar for blog, promotion, and review pages. https://shorturl.at/Z2YL8

  • 1. Use HTTP/2, please check with your host service.

    2. For the hero image, use a smaller image on mobile, try this PHP code:

    function db_modify_srcset_sizes($sizes, $size) {
            $sizes = '(max-width: 420px) 280px, (min-width: 421px) 600px, (min-width: 769px) 1080px, 100vw';
    	return $sizes;
    }
    add_filter('wp_calculate_image_sizes', 'db_modify_srcset_sizes', 10 , 2);

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    OR

    Add another dynamic image just for mobile only, and select medium size for the image.
    Hide the original featured image by adding hide-on-mobile class, and hide the new one by adding hide-on-tablet, hide-on-desktop classes.

    Adding CSS class(es): https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/

    3. You can preload the featured image by adding this PHP code:

    // In your theme's functions.php or a custom plugin
    function preload_featured_image() {
        if ( is_single() || is_page() ) {
            $featured_image_url = get_the_post_thumbnail_url( get_the_ID(), 'full' );
            if ( $featured_image_url ) {
                echo '<link rel="preload" href="' . esc_url( $featured_image_url ) . '" as="image"/>';
            }
        }
    }
    add_action( 'wp_head', 'preload_featured_image' );
    
  • I have tried both options for question 3, part 2. I feel that there’s no difference on the original page. Sometimes, the LCP even increases. And now I have that setting in place. Can you check if I have followed the correct steps? As for part 1, I’m still not sure until I get an answer from the service provider.

  • Double-checked with hosting that the Use HTTP/2 function had already been enabled.

  • Hi there,

    I’ve analyzed your site using PageSpeed Insights, and your Core Web Vitals are in the optimal range. (Passed)
    https://pagespeed.web.dev/analysis/https-dloveveryclinic-com-apply-sunscreen-regularly-but-why-do-i-still-have-blemishes/8xkkoav9al?form_factor=mobile

    You shouldn’t focus on achieving a perfect performance score, as it’s largely superficial. The key metrics to prioritize are LCP and CLS , both of which are already well within the “Good” threshold, indicating strong site performance.

    It’s also important to note that PageSpeed tests simulate a slow 4G network environment, which means real-world performance on faster connections will likely yield even better results. Therefore, your current optimizations are sufficient, and there’s no need to pursue a perfect score.

  • “Thank you to all team members who tried to help, and I think I’ve found my solution.”

  • Glad to hear that 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.