Largest Contentful Paint In WordPress: Advanced Guide To Improving LCP Score

Largest contentful paint wordpress 1

Largest contentful paint is the core web vital people struggle with most.

Google’s video on optimizing LCP is a great watch and breaks LCP into 4 parts: TTFB, resource load delay, resource load time, and element render delay. Philip gives solid recommendations to improve each part, but they’re not WordPress-specific (pretty much why I wrote this tutorial).

For example, it’s hard to mention TTFB without talking about Cloudflare Enterprise + full page caching. Cache plugins have specific settings that can help (or hurt) LCP. Themes/plugins that add lots of CSS/JavaScript impact it too. Follow these tips and I bet your LCP will be under 2.5s.

LCP measures how long it takes the main content to load. People struggle with LCP because there are lots of factors. Your above the fold content is a good place to start.

Largest Contentful Paint Score
0 – 2.5s Good
2.5 – 4s Needs Improvement
Over 4s Poor


1. Learn Which LCP Parts You Need To Work On

Largest contentful paint is broken down into 4 sub-parts. Skip to 12:40 in Google’s video for quick tips to improve each part. Otherwise, I listed tips below.

Largest contentful paint breakdown google
Credit: Google’s LCP breakdown
LCP Sub-Part Factors LCP %
TTFB Primarily hosting and CDNs + full page caching ~40%
Resource load delay Exclude above the fold content from optimizations, resource hints <10%
Resource load time Reduce image/CSS/JS sizes, critical CSS, CDN, cache expiration ~40%
Element render delay Render-blocking CSS/JS, JS file size, font-display optional <10%


  • KeyCDN Performance Test – measures TTFB in 10 global locations.
  • Waterfall Chart – nice visualization showing which files are contributing to LCP.
  • PSI Recommendations – many recommendations in PageSpeed Insights are correlated with LCP. Fixing recommendations shown in opportunities/diagnostics reports can help.
  • Chrome Dev Tools Coverage Report – large, unoptimized CSS/JS files are one of the biggest LCP factors. This can help you find which plugins and third-party JavaScript take longest to load. The plugin names and third-party domains are usually listed in the URL.
Chrome dev tools lcp waterfall time 1
Chrome Dev Tools Waterfall chart shows files loading within the LCP time


2. Exclude Above The Fold Images From Lazy Load

Above the fold images should be shown immediately, but lazy load delays them and adds to the “resource load delay” part of LCP.

It can be time consuming to go through every single page/post and exclude these images manually. While logos and top sidebar images may be universal across most of your website, your top post image (#3 in the screenshot below) is often unique for every single page and post.

Above the fold images

They also happen to be my largest contentful paint element for most posts:

Largest contentful paint element

Preloading critical images is usually the best method. Not only does it preload above the fold images, but it also excludes them from lazy load. It’s supported by Perfmatters and FlyingPress. Just set the number of images usually shown above the fold and the plugin will handle the rest.

Preload critical images perfmatters

You can also exclude leading images, but it won’t preload them.

Exclude leading images from lazy load

If your cache plugin doesn’t support either of these, you’ll need to manually go through your pages/posts, copy all image URLs loading above the fold, then exclude them manually. Some cache plugins have exclusion methods which you should be able to find in their documentation.

Background Images

Background images aren’t lazy loaded since they’re often loaded from a separate CSS file. Some cache plugins have a lazy-bg helper class to lazy load them while WP Rocket requires moving them to inline HTML. Since they’re not lazy loaded, there’s usually no need to exclude above the fold background images, but you’ll need to lazy load these manually if they load below the fold.

Elementor Image Widgets

Elementor image widgets aren’t excluded from lazy load by default since they don’t use img tags. Cache plugins sometimes have a skip-lazy helper class for excluding images manually.

Optimizing Above The Fold Images Is Key

Just like you would optimize any image on your site, it’s even more important to do this for above the fold images. Compress them, use correct dimensions, faster image formats (i.e. WebP), and serve smaller image sizes to mobile devices via CDNs or an adaptive images plugin.


3. Prioritize Above The Fold Images

If you’re preloading critical images shown in the previous step, you shouldn’t need to do anything since above the fold images are already being prioritized and excluded from lazy load.

However, preload has drawbacks and Google recommends only using it for background LCP images, then using fetchpriority especially for your LCP image shown in PageSpeed Insights.

Here, we’re giving the LCP image a high fetchpriority while using the faster WebP version.

<link fetchpriority="high" rel="preload" href="/LCP-image.webp" as="image">

As of writing this, FlyingPress is the only cache plugin I know that supports fetchpriority shown in their changelog in version 3.9.0.

Flyingpress fetchpriority=

Another Challenge For Background Images

If your LCP image is a background image and loads in a separate CSS file like Elementor does, your LCP image won’t be preloaded. You need to move the background image to inline HTML and preload it, or preload both the background image and the CSS file the image is located in.

“To eliminate unnecessary resource load delay, your LCP resource should always be discoverable from the HTML source. In cases where the resource is only referenced from an external CSS or JavaScript file, then the LCP resource should be preloaded.”


4. Reduce CSS/JavaScript Sizes

Resource load time is 40% of LCP and CSS/JS are usually your largest files.

View your Chrome Dev Tools coverage report and look at the URLs which usually tell you whether certain plugins, themes, third-party JavaScript, or other files add the most bytes.

Css javascript chrome dev tools


  • Themes – the last thing you want to do is start with a bloated theme/page builder and install multiple heavy page builder plugins. Elementor/Divi are notoriously slow while Gutenberg is lightweight. GeneratePress, Blocksy, Kadence for the win.
  • Plugins – the coverage report shows which plugins add the most CSS/JavaScript. Try moving plugin-dependent content below the fold like social sharing plugins and image galleries. Mega menus are awful for LCP since not only do they add CSS/JS, but they also add it above the fold on every single page of your website.
  • Remove Unused CSS – WP Rocket’s is slower than FlyingPress, Perfmatters, and LiteSpeed Cache as it loads used CSS inline instead of a separate file. Separate file is faster for visitors since the file can be cached and it doesn’t increase HTML size.
  • Minify – strips unnecessary characters from CSS/JS which reduces their file size.
  • Third-Party Code – start by hosting files locally (fonts, analytics, using local avatars for comments, YouTube preview images and thumbnails, etc). The rest of third-party code can usually be delayed. A common reason you’ll see this error in PSI is overtracking. Do you really need Google Analytics, Tag Manager, Heatmaps, Facebook Pixel, New Relic, and other tracking tools? Consider removing some of them. Perfmatters does an excellent job at reducing the size of GA tracking codes.
  • Asset unloading plugins – Perfmatters and Asset CleanUp are two popular plugins for removing individual CSS/JS files (or entire plugins) on specific content.
  • Page builder optimizations – Elementor Experiments and Divi’s built-in performance settings have several options to reduce the size of CSS, JS, and fonts.
  • Code header in CSS – don’t use slow page builders (or plugins) for your header or menus. Code them in CSS instead. It’s much faster than bloated page builder code.
  • Remove files you don’t use – icons, Gutenberg CSS, jQuery, emojis, elementor-dialog, and other individual files can be removed/dequeued when not using them.

Fastest wordpress themes
Some themes/page builders load more resources than others
Disable social sharing plugins perfmatters
Some plugins load CSS/JS across your site when they can be disabled on specific pages/posts
Elementor experiments
Page builders often have built-in settings to reduce CSS/JS


5. Reduce TTFB

TTFB alone is 40% of LCP and is explained in Google’s video at 5:24. This is mainly your hosting (and CDN). with their free Cloudflare Enterprise will outperform any “mainstream host” since you get 32 CPU cores + 128GB RAM, NVMe storage, Redis, and Cloudflare’s full page caching + Argo Smart Routing. I use them and average a <150ms global TTFB (or click through my posts).

12 things to know about hosting/TTFB

  1. Hosting is the #1 factor of site speed.
  2. TTFB is a key indicator of hosting performance.
  3. TTFB is part of core web vitals and is 40% of LCP.
  4. TTFB also affects INP (since latency is part of TTFB).
  5. SpeedVitals tests TTFB in 35 locations – use this tool!
  6. Test your site 3 times to get accurate numbers in SpeedVitals.
  7. Doing this ensures your caching and CDN are working properly.
  8. Check your average TTFB worldwide in your 3rd SpeedVitals test.
  9. Google flags your TTFB if it’s over 600ms, but under 200ms is better.
  10. PageSpeed Insights (and other testing tools) only test TTFB in 1 location.
  11. WP Hosting Benchmark also tests hosting performance (here are my results).
  12. Combining a good host/CDN is arguably the best way to improve TTFB (using a host with improved specs on top of Cloudflare Enterprise hits 2 birds with 1 stone).

Omm ttfb speedvitals 1

Mainstream hosts (like SiteGround, Hostinger, and WPX) don’t have a lot of CPU/RAM, use slower SATA SSDs, and are shared hosting with strict CPU limits which force you to upgrade plans. Cloud hosting is faster, but Kinsta still uses SATA SSDs with low CPU/RAM, PHP workers, and monthly visits (Redis also costs $100/month). Cloudways Vultr HF is who I previously used, but again, they start with only 1 CPU + 1GB RAM on slower Apache servers, PHP-FPM, and GZIP.

Here are’s:

All plans use 32 CPU cores + 128GB RAM with NVMe (faster than SATA), Redis (better than memcached), LiteSpeed’s PHP, and Brotli (smaller compression than GZIP). They have no PHP worker limits since only about 10% of traffic hits your origin due to their Cloudflare Enterprise.

SiteGround Hostinger Kinsta Cloudways Vultr HF
Hosting type Shared Shared Cloud Cloud Private cloud
CPU cores Not listed 1-2 12 1 32
RAM (GB) Not listed .768 – 1.536 8 1 128
Object cache Memcached x Redis ($100/mo) Redis (Pro) Redis
Server Nginx LiteSpeed Nginx Apache Nginx
PHP processing FastCGI LiteSpeed FastCGI FPM LiteSpeed
Compression Brotli Brotli Brotli GZIP Brotli
CPU limits Very common Low memory PHP workers Average None

Why you need Cloudflare Enterprise

Because you get Enterprise features like 270+ PoPs, prioritized routing, full page caching, HTTP/3, WAF, and image optimization. 3 problems with most CDNs are their small network (PoPs) and no full page caching or image optimization. For example, WP Rocket’s RocketCDN uses StackPath which was removed from and doesn’t include image optimization with a mediocre Tbps speed of 65+. SiteGround’s CDN only has 14 PoPs. CDN (for LiteSpeed) and BunnyCDN are good, but they still don’t beat Cloudflare Enterprise. Sure, you can pay $5/mo for Cloudflare’s APO, but you’re still missing out on all other Enterprise features.

3 popular hosts with Cloudflare Enterprise’s Cloudflare Enterprise is free, setup automatically, and uses full page caching (unlike Cloudways). And unlike Kinsta’s, has Argo Smart Routing (specifically good for WooCommerce sites), load balancing, and image optimization. CEO Ben Gabler also used to be StackPath’s Chief Product Officer and went as far as building’s data centers in the same locations as Cloudflare’s. And unlike both hosts, doesn’t limit PHP workers (there’s no CPU limits) and monthly visit limits are 10-25 times more than Kinsta’s.

Cloudflare Enterprise (Kinsta) Cloudflare Enterprise (Cloudways) Cloudflare Enterprise (
CDN PoPs 270 270 270
Prioritized routing
Full page caching x
Argo smart routing x
Load balancing x
Image optimization x
Automatic configuration x x
Price Free $5/mo (1 domain) Free

Problems with mainstream hosts

I’ve written some pretty bad reviews about SiteGround’s slow TTFB, CPU limits, and why SG Optimizer does a poor job with core web vitals (they also control several Facebook Groups and threaten to sue people who write bad reviews). Hostinger writes fake reviews and is only cheap because you get less resources like CPU/RAM. Kinsta and WP Engine are way too expensive for how many resources, PHP workers, and monthly visits you get. Along with major incidents like WPX’s worldwide outage and SiteGround’s DNS getting blocked by Google for 4 days (both WPX and SiteGround denied responsibility). One thing is clear: most mainstream hosts appear to be more interested in profits than performance. Please do your own research before getting advice.

Getting started

Step 1: Create a account and you’ll be prompted to add a coupon. Sign up with coupon OMM1 to get your first month for $1 (renews at $30/mo or $25/mo when paying yearly). If you sign up with my coupon or affiliate links, I get a commission which I seriously appreciate.

Rocket. Net omm1 coupon

Step 2: Request a free migration. They did this the same day and let me review my website before it was launched with no downtime. For the record, their support is better than Kinsta’s and you can reach out to Ben Gabler or his team (via phone/chat/email) if you have questions.

Step 3: Upgrade to PHP 8.1 and ask support to install Redis (they use Redis Object Cache). These are the only things I did since Cloudflare Enterprise and backups are both automatic.

Step 4: Retest your TTFB in SpeedVitals and click through your pages to see the difference. You can also search their TrustPilot profile for people mentioning “TTFB” where they’re rated 4.9/5.

Kinsta to rocket. Net migrationMoved to rocket. Net vs sitegroundRocket. Net positive review

Rocket. Net facebook review 1Rocket. Net vs kinstaKinsta to rocket. Net ttfb redis

Namehero cloudways rocket. Net
I agree with this for the most part

I was previously on Cloudways Vultr HF which was great, but their Cloudflare Enterprise doesn’t use full page caching (yet) and is $5/mo with annoying challenge pages. Even if their Cloudflare Enterprise was identical, still outperforms them with better specs like more CPU/RAM, Brotli, and LiteSpeed’s PHP (plus better support, easier to use, and usually pricing). While Cloudways is a big improvement than most hosts, you’re already spending $18/mo for Vultr HF’s lowest 1 CPU plan with Cloudflare Enterprise. At that point, the extra $7/mo you’d be spending at is worth it.’s dashboard is also much easier.

For small sites on a budget, NameHero’s Turbo Cloud plan is similar to Hostinger between LiteSpeed, cPanel, and pricing. However, NameHero’s Turbo Cloud plan has about 1.5x more resources (3 CPU + 3GB RAM) with NVMe storage. NameHero’s support/uptimes are also better shown in TrustPilot reviews. This is one the fastest setups on a budget… you get a LiteSpeed server + LiteSpeed Cache + CDN, and email hosting. The main con is their data centers are only in the US and Netherlands. If these aren’t close to your visitors, make sure to setup’s CDN which has HTML caching (ideally the paid plan which uses all 70 PoPs).

Cpu cores on litespeed hosting plansLitespeed cache litespeed server

Ram on litespeed hosting plansNamehero vs siteground feedback

Latency is also included in TTFB. Two simple ways to improve this are using a fast DNS like Cloudflare and tweaking Cloudflare SSL/TLS settings (using higher TLS versions for example).


6. Eliminate Render-Blocking CSS/JS

These contribute to “element render delay” which is 10% of LCP.

The easiest way to eliminate render-blocking resources is to view your PSI report and learn whether these files are from CSS or JavaScript (also take note of where they’re loading from).

Critical CSS loads above the fold CSS faster and most cache plugins have settings for it. You can use a critical CSS generator, but this isn’t preferred since critical CSS can be different depending on the page/post and changes if you make CSS changes where critical CSS needs to be updated.

Wp rocket critical css 1
Check documentation on how to make sure critical CSS is working

Deferring JavaScript pushes JavaScript files into the footer so they’re loaded non render-blocking. Again, most cache plugins have a setting for this. If enabling it breaks your website, you should really try to exclude problematic files rather than disabling the setting completely.

Autoptimize and Async JavaScript are also good for handling render-blocking CSS/JS. For a deeper guide in Chrome Dev Tools, see 6:27 of Google’s video on improving load performance.


7. Use Font-Display: Optional

Fonts add delays when they’re not loaded properly which increases LCP and causes layout shifts. It’s often a tradeoff between FOIT (flash of invisible text) or FOUT (flash of unstyled text).

Foit vs fout

If you need to ensure text remains visible during webfont load, use font-display: optional which is recommended by Google for optimal performance. Most tools only support “swap” like cache plugins, Elementor, and even dedicated font plugins like OMGF and Swap Google Fonts Display. You can either just use the swap method, or use font-display: optional by editing your font’s CSS and adding the code yourself. The only plugin I know that supports optional is WP FOFT Loader.

@font-face {
font-family: "Lato Regular";
font-weight: 300;
font-style: normal;
src: url("fonts/Lato-Regular-BasicLatin.woff2") format("woff2");
font-display: optional;
Elementor google fonts swap
Most plugins only support font-display: swap


8. Reduce Font Requests And File Sizes

LCP is the load time of your main content which fonts are part of.

Font Optimization 101

  • Use WOFF/WOFF2, not TTF.
  • Consolidate font families, weights, icons.
  • Disable font icons if you’re not using them.
  • Host fonts locally (instead of
  • If they load from, preconnect that domain.
  • Once hosted locally, preload important font files loading above the fold.
  • Inline fonts (some cache plugins do this or use Elementor’s inline experiment).

Local vs third party fonts


9. Lazy Render HTML Elements

FlyingPress and LiteSpeed Cache can lazy render HTML elements.

This is similar to lazy loading images but can be done for any element on your website (#comments and #footer are common, just make sure to copy selectors for your own site as shown in the video). It improves LCP by letting browsers focus more on above the fold content.

Lazy render html elements flyingpress


10. Preload, Preconnect, Prefetch

Other than prioritizing above the fold images, there may be other files you can prioritize with resource hints. This can be done in most optimization plugins or by adding code to your head.

The “avoid changing critical requests” section of PSI shows resources loaded with a high priority. You should also consider preloading self-hosted fonts and CSS/JS files needed for above the fold content. Just make sure you test your results (in your Waterfall chart) after adding each resource hint. Too many hints or not using them correctly can hurt performance.

Avoid chaining critical requests

Preload – can also be done with above the fold fonts, CSS, JS, and other files types. For example, you could preload the WordPress Block Library stylesheet. Fonts should use the crossorigin attribute. As with all resource hints, test performance after each hint is added.

<link rel="preload' href="/style.css" as="style">
<link rel="preload' href="/script.js" as="script">
<link rel="preload' href="/font.woff2" as="font" crossorigin>

Preconnect – usually only done with CDN URLs (i.e. BunnyCDN) and third-party fonts (i.e. Cloudflare doesn’t use a CDN URL and most cache plugins automatically preconnect the CDN URL when you add it to the plugin settings. Since fonts should be hosted locally and CDN URLs are preconnected by cache plugins, there’s usually no need to do this.

<link rel="preconnect" href="/assets/vendor/gstatic" crossorigin>
<link rel="preconnect" href="" crossorigin>

Prefetch – usually nothing to do here unless you have third-party code loading above the fold, like a social sharing plugin loading at the top of your blog making requests to Facebook. Third-party code should be delayed when it’s loaded below the fold instead of using the prefetch hint.

<link rel="dns-prefetch" href="">


11. Optimize Images

While above the fold images are the most important to optimize largest contentful paint, all images are obviously important. Most of these are recommendations in PageSpeed Insights.

I prefer image CDNs like Cloudflare Mirage + Polish (what I use with Cloudflare Enterprise) or Bunny Optimizer which eliminates the need for image optimization plugins and are automatic.

  • Serve smaller Images to mobileCloudflare’s image resizing and Bunny Optimizer resize images for mobile while other CDNs like RocketCDN do not. Or you can use ShortPixel Adaptive Images. This can improve your mobile LCP score.
  • Properly size images – crop/resize images to their correct dimensions.
  • Compress images – Lighthouse tests images at 85%, so that’s a good number.
  • Specify image dimensions – most cache plugins have a setting to add missing image dimensions. Otherwise, you can manually add a width/height attribute to the image’s HTML which makes the image load faster and prevents layout shifts.
  • Use WebP – faster image format supported by most image CDN/plugins. You could even use a WebP converter to only convert above the fold images if you don’t want to make the full switch yet. If you’re not using WebP, know when to use jpg or png.

Image optimizations


12. Use Brotli When Possible

Brotli compresses files to smaller sizes than GZIP. The trick is finding a host that supports it, for example, and Kinsta do. Check with your host and consider this next time you move.

Brotli cpanel


13. Increase Cache Expiration Time

Longer cache expirations prevent the server from rebuilding the cache as frequently and improves LCP with better cache hit ratios. Google also suggests this in a YouTube video on LCP.

If using Cloudflare, you can do this under browser cache TTL in the Caching settings. Google recommends 1 year to fix “serve static assets with an efficient cache policy”. This is good for static sites (like my blog) but WooCommerce and dynamic sites should only use about 1 month.

Cloudflare browser cache ttl


14. Choose The Right Cache Plugin And Settings

Again, while I try to keep things unbiased, FlyingPress is clearly better at optimizing LCP than WP Rocket and SiteGround Optimizer. Gijo is usually the first to release new features which address core web vitals like delaying JavaScript or adding fetchpriority. Sometimes WP Rocket follows, but other times they don’t add a feature at all. SiteGround Optimizer is far behind both and primarily optimizes for caching instead of core web vitals (with lots of compatibility issues).

WP Rocket has no image optimization, their CDN has no features other than serving files, no documented APO compatibility (still), and way too many lacking features to keep paying for it.

Use FlyingPress or LiteSpeed Cache, not WP Rocket or SiteGround Optimizer.

I have tutorials for nearly every cache plugin.

LCP Optimization SG Optimizer WP Rocket FlyingPress
Preload critical images x x
Exclude leading images x x
Fetchpriority resource hint x x
Remove unused CSS x Inline Separate file
Critical CSS x
Font-display: swap x
Lazy render HTML elements x x
Documented APO compatibility x x
CDN SiteGround CDN StackPath BunnyCDN
Image optimization via CDN x x
Serve small images to mobile via CDN x x

Omm switches to flyingpress


15. Enable Signed Exchanges (SXGs) In Cloudflare

Signed Exchanges improve largest contentful paint when people click your links in Google’s search results (through prefetching). Google lists Cloudflare in their documentation and says enabling it can lead to a substantial improvement. This is found under Speed → Optimization.

Cloudflare automatic signed exchanges


16. Use Cloudflare Workers For Serverless Rendering

Philip Walton was able to reduce LCP by about 80% using service workers.

Cloudflare has documentation on deploying a static WordPress site which is mainly for developers (which I don’t consider myself one), but I’ll leave it here in case you want to try it.

I’m a blogger, I know my limits :/

Cloudflare workers examples
See examples


17. Move Plugin Content, Ads, And Animations Below The Fold

I want to emphasize that large, unoptimized files loading above the fold increases LCP.

Loading Google AdSense in your header, heavy image galleries or animations at the top of content, mega menus, and social sharing plugins at the top of your blog is usually not a good idea. Sure, you may be able to optimize them, but if you can’t and they’re killing your LCP or other scores, try moving them below the fold so they can be delayed or optimized other ways.

Perfmatters delay javascript
Plugins and third-party code loading below the fold can be delayed

How do I improve largest contentful paint in WordPress?

LCP can be improved by optimizing above the fold content, eliminating delays, and reducing/optimizing files and TTFB. Since LCP measures the load time of main content in the viewport, there are many factors.

How do I improve largest contentful paint using WP Rocket?

WP Rocket optimizes LCP with features like critical CSS, font-display swap, and removing unused CSS. However, it lacks LCP optimizations like automating the optimization of above the fold images, fetchpriority hints, and serving smaller images to mobile devices. These features have already been added in other cache plugins or their CDNs, not in WP Rocket.


You Might Also Like:


  1. I’m still having a bit of trouble wrapping my head around LCP but thanks for laying it down, Tom. Love the new look here!

    • Chrome Dev Tools Waterfall chart is the best thing to look at. Thanks Malik! There should be a “version 2” coming out by the end of the year with a bunch of updated tutorials, but the main ones like this are “done.”


Leave a Comment