🔥 🥳 Get your Wordpress Pagespeed optimized today for $99 🔥 🥳 Conditions apply.

How To Improve or Fix Largest Contentful Paint (LCP) Issue in WordPress and boost SEO

Last updated on October 18, 2021 | By

Google Core Web Vitals is here. Google launched the Page Experience Signal update, which brings many changes to SERP ranking, as the boost it brings for websites with Good Core Web Vitals.

To help improve your Core Web Vitals, we choose the best available optimization tasks on fixing and improving LCP on WordPress.

Understanding LCP metrics: What is a good result

The Core Web Vitals are ranked as “Good”, “Needs Improvement” or “Poor” labels, together with green, yellow and red colors. These are the labels you’re gonna receive at Search Console, alongside the issue.

To get an LCP “Good” label, it should load within 2.5 seconds of when the page first starts loading. According to Google, a good threshold to measure for this metric is the 75th percentile of page loads, segmented across mobile and desktop devices.

lcp

How to check your LCP

As a tip of ours, always check for Core Web Vitals field data or strive for results from live users. Since Search Console Core Web Vitals data may take a while or be delayed for small website owners, we recommend testing simulating most of your userbase or s setting up a tool to capture Core Web Vitals field data.

To get field data we recommend Web Analytics by Cloudflare, which we have a guide for: How To Get Core Web Vitals Field Data

For testing Core Web Vitals lab data and field data(when your website has enough data) use Pagespeed. Go to Pagespeed Insights, do a page test, and go to “Largest Contentful Element” under the results. There are two results, mobile, and desktop, the first we go to is mobile:

image 1

The mobile LCP in the result above is a <h2> tag, a text element.

image 3

The desktop LCP in the result above is also a <h2> tag, a text element.

To see issues related to the LCP, click on the tab below the screenshots “Show audits relevant to” and click LCP.

image 2

8 ways to fix or optimize your LCP in WordPress

After getting field data on Search Console, you’re gonna receive Core Web Vitals results. If you’re presented with the LCP issues – “lcp issue longer than 2,5s” or “lcp issue longer than 4s”, consider the following solutions for solving them.

Change the slider, background-image to a CSS background-color or an animated CSS background with SVG’s

Impact on load time: ⭐⭐⭐⭐⭐

If you couldn’t solve the “lcp issue: longer than 2.5s” issue, you can switch your header background from an image to a simple CSS background color(gradient-color) or an animated CSS background. This can remove more than 2 seconds in some cases from LCP loading time. It can also reduce the CLS.

Use a blurry placeholder technique on javascript elements(dynamic) or large images, properly reserving space for them.

Consider a CSS-only element to reduce the amount of loading time for the LCP.

Setup critical CSS

Impact on load time: ⭐⭐⭐

Consider a critical css plugin to load the essential css before any assets. Jetpack recently launched Jetpack Boost plugin for free and it generates Critical CSS for your homepage, posts, and pages. You can also use WP Rocket(paid) and its Optimize CSS delivery feature. Choose a plugin that is compatible with your current plugins.

If you haven’t bought Wp Rocket yet, consider using my ref link for a 10% discount.

Cut and use a different image for the mobile

Impact on load time: ⭐⭐

Cut the size of your LCP image and use a smaller image for the mobile viewport. Modern themes have built-in UI to change responsive images.

Use a CDN for images and SVG’s plus lazyload your images

Impact on load time: ⭐⭐

Upgrade the load time from your images, with an image CDN. You can use our list with the 8 best and free CDN plugins for WordPress.

If you have many background images, you need to choose an Image CDN service that supports background images, or use Jetpack Image CDN and add the images manually:

/* Replace $image with whatever variable or function is being used to store the image URL or an id, class from the image.*/

if (function_exists('jetpack_photon_url')) {
$image = jetpack_photon_url($image);
}

Popular Image CDN plugins:

Jetpack(Free unlimited image CDN)

ImageKit (Free 20GB monthly tier, SVG support, WEBp support)

Serve HTML pages cache-first (Paid)

Impact on load time: ⭐⭐

Cloudflare currently offers Automatic Platform Optimizations (APO) for 5$ USD/mo, and it caches the HTML of your WordPress website. This is possible due to Cloudflare Workers that cache dynamic content. Cloudflare APO can also improve First Contentful Paint(FCP) and Speed Index.

Cloudflare APO is compatible with WP Rocket and many other plugins, check the compatibility here.

Optimize DOM by avoiding page builders

Impact on load time: ⭐⭐⭐⭐⭐

Consider a theme that has a mobile-first CSS approach, a stylesheet for mobile and desktop. Update your theme builder to the latest release, it may have improvements on its CSS, and thus the DOM.

Elementor has a feature to optimize the DOM, go to Elementor > Settings > Advanced. Using this feature can potentially break your website features, use it wisely.

image 6
Elementor Optimize DOM feature

Preload the largest contentful paint image and disable unecessary lazyloading

Impact on load time: ⭐

To preload the largest contentful paint (LCP) image, follow the steps:

  • Install the Head & Footer Code
  • Go to the page where you want to preload the images
  • Add the following preload <link> tags to Header & Footer Code > Head Code
<link rel="preload" as="image" href="your_image_here.png">

By using the Head & Footer Code plugin, you’re making sure you’re preloading the image only when necessary, since each page may have a different LCP.

How to preload a responsive largest contentful responsive image

To preload a responsive image you can add imgsrcset and imagesizes to the <link> element. For preload the following image:

<img src="bear.jpg" srcset="bear_400px.jpg 400w, bear_800px.jpg 800w, bear_1600px.jpg 1600w" sizes="50vw" alt="bear test image">

You can do as following:

<link rel="preload" as="image" href="bear.jpg" imagesrcset="bear_400px.jpg 400w, bear_800px.jpg 800w, bear_1600px.jpg 1600w" imagesizes="50vw">

Lazyloading the LCP image may delay its appearance. You can disable the lazyload and preload the logo and the first image of the slider, for example. You should avoid lazy loading elements inside the viewport(above the fold), and lazyload images below the fold, outside the viewport.

Improve icon font loading, remove unused icon fonts, or switch icons to SVG’s

Impact on load time: ⭐

Icon Font is responsible for most of the bad LCP across WordPress websites.

To improve font loading and LCP, go to your website, look for all the icons used on the pages, and note each class name down. Load only the necessary classes on the font icon css file now.

Font Awesome has a cheat sheet listing all icon assets classes name: https://fontawesome.com/v5/cheatsheet/free/

Fontello lets you build a css and font files choosing only the necessary icons from various icon types, such as Font Awesome, Typicons, Entypo, and many more: https://fontello.com/

You should have a reminder that for adding new icons, it will need to be manual. 

Limit acess of a region with failing Core Web Vitals

Impact on load time: ⭐⭐⭐⭐⭐

Limit access to a region where you’re failing Core Web Vitals. Install and set up Cloudflare Web Analytics. With the data available you’re able to define if some country is contributing to lower the Core Web Vitals. Install Cloudflare DNS and block the region via firewall rules.

Get a Core Web Vitals Boost

Send us your request!

Leave a Comment