WPLift is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission.

Largest Contentful Paint: What is It and How to Optimize for It (2021)

Last Updated on September 27th, 2021

Published on July 24th, 2020

Tags: ,

Share This Article

Because the field of user experience metrics is evolving at a rapid pace, a new language is required. The Largest Contentful Paint (LCP) is one of several measures for determining how long it takes for content on a web page to render.

We’ll discuss what LCP is and how to quantify them in this article. Then we’ll go over a few suggestions for speeding up your loading times. Let’s get started!

What is the Largest Contentful Paint (LCP)?

Because it is user-centric, LCP is a crucial metric for the Web Vitals score. It measures whilst the most important detail of a given internet web page will become seen withinside the consumer’s browser.

LCP is a consumer-centric metric due to the fact the most important detail withinside the viewport is normally the maximum important and rendering it as quickly as feasible improves your visitors’ consumer revel in.

LCP appears for the most important detail loaded withinside the viewport for the duration of the method of loading the web page and reviews the time it took to render that detail for the reason that the web page commenced loading.

The LCP detail is normally the hero picture or a massive textual content paragraph.

What Is a Good LCP Rating?

Because LCP measures time to render, the decrease your rating is, the higher, due to the fact your customers will see the critical content material sooner.

LCP should be less than or equal to 2.5 seconds for a solid score. If this is the case, the page will receive a green score and pass the test. 

If your LCP is between 2.5 and 4.0, you’ll earn an orange grade since your score “requires improvement.” 

Assume that the LCP is greater than 4 seconds. The score is then “bad,” and you must correct it as quickly as possible.

Article Continues Below

Why is LCP Important?

Now that we know what Largest Contentful Paint is and what it does, we can look at why this measure is so crucial for SEO. Site speed is widely acknowledged in the SEO industry as a ranking criterion, but there are a variety of reasons for this, and as a result, a variety of reasons why LCP will have an influence on SEO. 

We’ll look at the reasons why a decent LCP is vital for SEO and increasing the visibility of your websites to your target audience in the sections below.

  • This statistic was produced and recommended by Google themselves. 

The fact that Google advises using this indicator already demonstrates its significance. LCP will be the default factor for measuring a web performance audit starting in May of this year. 

  • The speed with which your website loads has an impact on your rankings. 

On both mobile devices and desktop computers, Google favors pages that load quickly. The position of pages in the SERPs will be affected once Google starts actively using LCP. 

  • The most contentious paint has an impact on the user’s experience. 

The user experience is influenced by the largest contentful paint. The poorer your user experience is, the higher your bounce rate will be and the lower your search ranks will be. The bounce rate can drop for a variety of causes, so read the blog on how to lower the bounce rate for more information.

How Largest Contentful Paint (LCP) reported?

The LCP can only be defined as the items that are rendered and remain visible to the user. Rendering is not applied to elements that have not yet loaded. As a result, these elements aren’t taken into account while determining the Largest Contentful Paint. When elements lower on a page are in the user’s viewport, they can become the LCP. 

Even if an LCP element is removed from the viewport, it may still be the most contentful. Until another larger element is produced on the page, it will remain the LCP. When a user interacts with a page, there’s a significant probability that the LCP elements will change as well.

What Types of Content Qualify for LCP? 

This measure isn’t triggered by every sort of produced content. At the time of writing, the following elements are available:

  • img> elements 
  • <image> elements> tags within <svg> 
  • An image of a <video> tag as a poster (not the whole video file) 
  • Using the CSS url() method, a background image can be set. 
  • Text nodes (which are usually the main text content) and other inline-level text components are found in block-level elements.

How to Measure the Largest Contentful Paint?

Google’s PageSpeed Insights

Using Google’s PageSpeed Insights tool is the simplest approach to determine your website’s Largest Contentful Paint. It will generate a lab-based evaluation of your website and return genuine user data that Google has already collected. These findings are divided into two categories: field data and lab data. 

Article Continues Below

Because Google’s lab test employs a rather slow network connection, your metrics will typically be slower in the lab than they are for real users. For example, the field LCP for you on Youtube is 3.1s, however, the lab test yields a value of 7.8s. 

The lab data will improve quickly if you speed up your website. However, collecting up-to-date real-user data will take some time.

Because the lab test is done with Lighthouse, PageSpeed Insights also delivers a more detailed page analysis that identifies areas for improvement. 

In the Diagnostics section, you can also find the element that created the Largest Contentful Paint.

Chrome DevTools

Because the lab test is done with Lighthouse, PageSpeed Insights also delivers a more detailed page analysis that identifies areas for improvement. 

In the Diagnostics section, you can also find the element that created the Largest Contentful Paint.

Check the time portions of a performance profiling. To see interesting details at the bottom, click on the LCP marker.

The Chrome UX Report (CrUX) 

The Chrome UX Report (CrUX) publishes statistics from millions of major websites about real users’ experiences. 

This information is used in Google’s BigQuery ML project, which collects user experience metrics by location. Each data set represents a specific country, with the goal of determining the user experience by region based on a few important metrics.

While this may not appear to be relevant to LCP and other performance indicators, the database includes an open API that lets developers get data for any website. 

Article Continues Below

That implies you can track LCP for your own site or your competitors if you know how to do some basic code. 

This report gives you a closer look into the consumer experience based on demographics, devices, and location.

How to Optimize for Largest Contentful Paint

Improve Slow Resource Load Times

  •  Images, background images, and video sliders should all be optimized. 

Image optimization can reduce the time it takes for a web page to load and improve the user experience. The load speeds can be improved by resizing, utilizing lower resolution photos and newer file types, and even eliminating images where necessary.

We’re not suggesting that you remove all of your photographs from above the fold in order to enhance load times, but it’s worth noting how significant these images may be.

  • Choose the Right File Format

The image formats JPEG and JPG (Joint Photographic Experts Group, pronounced jay-peg) are the same. Here, we’ll use the ‘JPG’ format. The file extension for JPG files is.jpeg or.jpg. For images with thousands or millions of colors, such as photographs, JPG is usually the best option. These are usually the largest files, and JPG is a master at compression. 

Photographs and photographic images should be saved in JPG format. Lossy compression is what JPG stands for. It shrinks files by deleting unnecessary data. That’s why JPG compression works so well for photographs with a lot of colors. It removes information from the system. While this can affect quality, JPG compression is nearly imperceptible when done correctly.

PNG (Portable Network Graphics, pronounced ping or pee-en-gee) is the best format for line art and other pictures with a limited color palette. 

All of these file types refer to the compression method used in image files. 

If your design requires transparent backdrops, use PNG for line art or photographs. A lossless file format is PNG. It operates by reorganizing data in order to make better use of file space. It does not significantly lower the size of the photographic image file. However, it’s wonderful for line art and graphics with limited colors. It also maintains transparency. 

The format you use makes a tremendous difference.

  • There are various new file types that allow web designers to create graphics that are smaller and more detailed than ever before. WebP is one of the most widely used formats. 

JPEG and PNG files are larger than WebP pictures. According to Google, converting an image to WebP can result in a 25–34 percent reduction in size. To achieve this decrease and enhance web loading times, this format combines both lossless and lossy compression (a method of data compression in which the size of the file is lowered by removing selective material from the file). 

However, WebP (along with other file formats like JPEG XL) isn’t supported by all browsers.

To convert image kinds, there are potentially hundreds of tools available. 

We’ll go through a handful here, but a quick Google search will turn up plenty more. 

cwebp is a command-line tool –  This is a nice alternative for simple projects if you’re familiar with command-line tools. You can choose whether to use lossy or lossless compression, as well as alter pixel values and other settings. 

Imagemin for WebP is a program that converts images into WebP format. If you’re using build tools or build scripts, this npm plugin is a better option. You can select compression kinds, sharpness, quality settings, and a variety of other parameters once again.

Squoosh is an app created by Google that allows you to compress, resize, and modify the quality of your images. Most notably, it has a slider that allows you to compare the image in various formats.

Squoosh
  • Serve Images That Are Responsive 

Serve the right picture size for the device on which it will be viewed to boost your LCP score. Desktop photos typically use 2-4 times more data than mobile images due to the fact that desktop screens are typically much larger than those available on mobile devices. Resizing photographs for different device types is a time-consuming operation, but it will pay off in the long term.

  • Use Global CDN

CDNs excel at image optimization. Amazon CloudFront is a popular CDN for Amazon Web Services websites (AWS). Duda’s platform uses AWS to serve its photos, which decreases their size and speeds up loading times.

  • Important Resources Should Be Preloaded 

Some website elements, such as CSS and JavaScript files, might be prioritized during loading, so think about which files need to be loaded first and which can wait. Fonts, above-the-fold graphics or videos, and crucial CSS or JavaScript are all elements that should be preloaded. 

  • Serving that is flexible 

It can be useful to conditionally fetch different materials depending on the user’s device when loading resources that make up the primary content of a page. This technique is known as “adaptive serving.” 

When it comes to loading material on mobile devices, adaptive serving comes in handy.

  • Assets to Cache Serving Smaller HTML 

Responses with a Service Worker Service workers can be used for a variety of functions, including serving smaller HTML responses. They can also be used to cache any static resource served to the browser instead of requesting it from the network on repeat requests.

Eliminate Render-Blocking JavaScript and CSS

JavaScript or CSS is considered “blocking” while the browser wishes to parse and execute CSS or JavaScript earlier than it is able to render any content material. Reducing the quantity of time that the show is “blocked” can be executed via way of means of following the under high-quality practices.

  • Minify CSS

Minifying the CSS method disposing of spacing, indentation, and feedback from the CSS documents is a good way to lead them to as small as possible. This is much like compressing the overall report size.

Use minifycode.com – With a simple and elegant UI, this site offers minifiers for JavaScript, CSS, and HTML that minify your code with a single click of a button. It also comes with a “beautifier” tool that decompresses minified code and makes it easier to read (basically the opposite of minification).

Steps to Minify CSS using minifycode.com

  1. Copy and paste your source code into the box or upload the source code file. 
  1. To minify or compress the code, select Minify CSS button. 
  2. Copy the output of the minified code or save the minified code file.
  • Defer Non-Critical CSS

Any pointless CSS ought to be removed, and any CSS now no longer wanted for the preliminary rendering may be loaded asynchronously.

  • Use Inline Critical CSS

Inlining essential CSS will assist the browser load pages greater fast via way of means of allowing it to load the maximum vital documents first.

  • Reduce JavaScript

Many websites nowadays depend closely on JavaScript, and this code is commonly referenced withinside the element. This activates the browser to process/load those assets first, rather than prioritizing the maximum vital content material.

As we’ve seen, it’s miles vital to prioritize content material above the fold. However, downloading and serving the minimum quantity of JavaScript may be challenging. Google recommends minifying and compressing JavaScript documents in addition to deferring unused JavaScript. 

Select a Web Server With Low Server Response Times

One of the most effective approaches to fix the most serious contentful paint element difficulties on your website is to reduce server response times. The most common cause of resources not loading quickly on websites is your hosting plan. A shared hosting plan will not provide lightning-fast server response times for most online stores. A slow host server makes it impossible to have a fast, responsive website. Aside from hosting, improving your server to handle traffic spikes is a smart approach to minimize LCP element problems.

Server reaction time is vital for SEO and for a person to enjoy as well. Some of the approaches to enhance server reaction time are indexed under:

  • Use a greater effective server (greater RAM and CPU)
  • Upgrade community gadget at the server

Optimize the underlying code to your server to reply quicker to inbound requests

This brings us to the end of our very extensive instruction on how to optimize your largest contentful paint timing issues.

Wrapping Up!

LCP is a measure that indicates the overall “health” of your website’s performance. Failure to monitor LCP and address issues, on the other hand, is a significant mistake that will affect not only the usability of your site but also your ability to attract customers in the first place.

Implementing the concepts covered in this post will boost LCP scores, improve the user experience, and help you achieve your conversion goals!

Stay informed on WordPress

Every Friday you’ll receive news, tutorials, reviews, and great deals from the WordPress space.

Invalid email address
A team of WordPress experts that love to test out new WordPress related software, WordPress plugins and WordPress themes.