WordPress image optimization, is to upload images in the size they appear on the screen, in a modern format and in the correct order. On most pages, more than half the total weight comes from images; Therefore, when images are edited, the LCP value and mobile boot time improve more significantly than any other setting. Three settings make the most difference: size, format, and loading order.

1. Install correct size

A 4000 pixel wide photo taken on the phone will be downloaded at full size, even if it is displayed in an 800 pixel area. Before uploading, reduce images to the maximum width they will be used in; For content images, 1200-1600 pixels is sufficient for most themes. WordPress produces copies of different sizes for each image and srcset Allows the browser to choose what fits the screen.

<img src="urun-800.webp"
     srcset="urun-400.webp 400w, urun-800.webp 800w"
     sizes="(max-width: 600px) 400px, 800px"
     width="800" height="600" loading="lazy" alt="Ürün görseli">

srcset lists copies of the same image with different widths. sizes tells the browser how much space the image will take up on the screen; on the narrow screen, a 400 pixel copy is downloaded. The width and height values ​​allow the image to be spaced before loading and prevent page scrolling (CLS).

2. Use modern formatting

FormatPlace of useNotes
WebPGeneral selection for photos and graphicsGenerally noticeably smaller file compared to JPG
AVIFbig photosSmaller file, slower conversion
SVGLogos and iconsClear at any size, very small
PNGOnly graphics that require transparencyShould not be used for photography

Current versions of WordPress support WebP installation. Optimization plugins convert existing JPG and PNG images to WebP and automatically present them to appropriate browsers.

3. Set the loading order

Lazy load does not download images at the bottom of the screen until the user scrolls. WordPress adds this property by default. However, the main image at the top of the page, usually the LCP element, should not be lazy loaded; otherwise the most important visual comes last. To the main image fetchpriority="high" Adding it tells the browser to download this image as a priority. On homepages that use sliders, only the image of the first slide should load immediately, the others should appear with a delay.

4. Balance the compression level

In lossy compression, the quality value is between 75-82, which significantly shrinks the file with a loss that is not noticeable in most photos. Keep the value slightly higher for images where detail is important, such as product photos. Lower value may be used for background and decorative images.

Example scenario

Imagine a hotel site has five 3MB slide images on its homepage and dozens of full-size photos in the room gallery. When images are reduced to 1600 pixels, converted to WebP, and only the first slide is loaded first, the mobile weight of the home page drops from a few megabytes to a few hundred kilobytes. Effect of change page speed test You can see by measuring before and after with our tool; You can watch in the report that the LCP value decreases and the page weight decreases.

Background images and page builders

Images added as CSS background in page builders cannot benefit from srcset and lazy load features. The large background image in the Hero area also downloads at full size on mobile. If possible, add these images with the regular image component or use the page builder's separate image option for mobile. Defining a smaller image on mobile significantly shortens the opening time of the first screen.

Common mistakes

  • Applying lazy load to the main image: The LCP value increases.
  • Removing width and height values: The content scrolls as the page loads.
  • Using two optimization plugins together: Images are processed twice, quality deteriorates.
  • Leaving the image alt text blank: It's not needed for speed, but for accessibility and visual search.

For other causes of speed problems Why does WordPress open slowly? See our article. To improve all layers with measurement, from visuals to the server WordPress speed optimisation Check out our page.

Does WebP work in all browsers?

All current browsers support WebP. Optimization plugins also offer JPG backup for older browsers if needed.

Does lazy load also delay the first image?

Yes if set incorrectly. The main image that appears at the top of the page should be excluded from lazy loading.

Can I batch convert old images?

Yes. Most optimization plugins batch process existing images in the media library in the background.