So, I’ve really tried a lot and haven’t made any progress. I’m dealing with the LCP score again, and I just can’t get it down.
I’ve looked at every guide here and tried various things, especially related to WP Rocket. However, some of the information seems outdated. WP Rocket support suggested excluding specific images from preloading. I found the line in WP Rocket where you can input these settings, but I’m not sure what exactly I need to enter to make it work. Does anyone here have any other ideas on how to lower the LCP score?
The latest image formats are in place, and all plugins and everything else are up to date.
-
This topic was modified 1 year by
deekendown.
Hello!
LCP measures how quickly the largest content element (e.g., image, video, text block) becomes visible within the viewport. Improving LCP involves optimizing various aspects of your WordPress site. Here’s a step-by-step guide on how to enhance LCP:
1. Optimize Images
Images are often the largest elements on the page, and optimizing them can significantly improve LCP.
Compress Images: Use tools like Smush, Imagify, or EWWW Image Optimizer to compress images without sacrificing quality.
Use Correct Image Format: Convert images to modern formats like WebP for faster loading.
Lazy Load Images: Lazy loading delays the loading of images until they’re needed. WordPress 5.5 and later versions come with native lazy loading, or you can use plugins like Lazy Load by WP Rocket.
Serve Scaled Images: Ensure images are served in appropriate sizes based on the device.
2. Enable Caching
Caching improves LCP by reducing server response times and decreasing the amount of work needed to load a page.
Browser Caching: Ensure that static resources like CSS, JS, and images are cached in the browser to speed up repeated visits.
3. Minimize CSS and JavaScript
Reducing the size and loading time of CSS and JavaScript files can help improve LCP.
Minify CSS and JavaScript: Use a plugin like Autoptimize to minify CSS and JavaScript files.
Defer Non-Critical JavaScript: Delay the loading of non-critical JavaScript by deferring or async loading to avoid blocking rendering.
Remove Unused CSS: Eliminate unused CSS using WP Rocket’s CSS optimization feature or manual removal for unneeded stylesheets.
4. Use a Content Delivery Network (CDN)
A CDN helps improve LCP by serving your content from servers closest to the user, reducing latency.
Integrate a CDN: Use services like Cloudflare, StackPath, or KeyCDN to serve static resources, like images, CSS, and JavaScript, from a global network of servers.
5. Optimize Fonts
Custom fonts can significantly affect LCP if not optimized properly.
Preload Key Fonts: Use the preload directive in your HTML to load important fonts early.
Use System Fonts: Alternatively, switch to system fonts for faster font rendering.
Font Display Property: Use the font-display: swap; CSS property to ensure text is visible while web fonts load.
6. Reduce Server Response Times (TTFB)
A fast server response time (Time to First Byte, TTFB) is essential for a good LCP score.
Upgrade Hosting: Choose a high-performance hosting provider, especially one that specializes in WordPress, like Kinsta, WP Engine, or SiteGround.
Use Latest PHP Version: Ensure your WordPress site is running the latest version of PHP (8.x) for better performance.
Database Optimization: Regularly clean up and optimize your WordPress database using plugins like WP-Optimize or Advanced Database Cleaner.
7. Reduce Third-Party Scripts
External resources can slow down the page, affecting LCP.
Minimize Third-Party Embeds: Reduce or optimize third-party scripts, such as Google Analytics, social media embeds, and advertising.
Use Tag Manager: If you use multiple tracking scripts, implement them through Google Tag Manager to load them asynchronously and reduce load impact.
8. Prioritize Above-the-Fold Content
The content visible above the fold (i.e., before scrolling) should load quickly for a better LCP score.
Inline Critical CSS: Inline essential CSS directly into the HTML to prioritize above-the-fold content. Tools like Autoptimize or WP Rocket can help with this.
Avoid Heavy Above-the-Fold Elements: Avoid large images or videos that slow down the loading of the above-the-fold content.
9. Use Lazy Load for Iframes and Videos
Similar to image lazy loading, delay loading of iframes and videos until they are needed.
Lazy Load Iframes: Use plugins like Lazy Load for Videos or WP Rocket’s built-in lazy load feature to defer video loading.
10. Monitor with Performance Tools
Continuously track your site’s LCP performance to identify new bottlenecks or opportunities for improvement.
Google PageSpeed Insights: Run your site through Google PageSpeed Insights to get a detailed breakdown of LCP issues.
WebPageTest: Use WebPageTest for deeper insights into your page load times and specific areas affecting LCP.
GTmetrix: Another tool that provides useful performance data, including LCP metrics.
By implementing these optimizations, you should see a noticeable improvement in your WordPress site’s LCP, resulting in a faster, more user-friendly experience.
Thank you!
Thanks fort he answer and
1. I do
2. I do
3. Ido
4. I do
5. Ido
6. –
7. –
8. I use wp rocket and i think (not sure) i make it right
9. I do
10. –
So, I’ve finally solved the issue, and I thought this might help others facing something similar. I disabled my WordPress cron jobs and now run them directly through my hosting provider, which seems to have made a slight improvement. I’m also using WP Rocket, and in the DNS-Prefetch section, I added the following:
`
//fonts.googleapis.com
//www.googletagmanager.com
//www.googletagservices.com
//tpc.googlesyndication.com
//use.typekit.net
//netdna.bootstrapcdn.com
//www.google-analytics.com
//ajax.googleapis.com
`
Additionally, I’ve enabled everything possible in WP Rocket, and now I’m getting great results!”
We need ability to to add to this setting on blocks images https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority
Currently our Featured Image on frontpage get loaded last and we get low LCP score.
On Posts it’s Ok because featured image is loaded with tag but block images are not.
Because images are loaded as css background-image: url(xxxx) and NOT as tags I can’t exclude them from lazyloading.
If the images where using tag we are add/remove lazyload and add fetchpriotity tag.
For great performance use Cloudflare and enable all their performance settings.
