Image performance

How to optimise WordPress images

To optimise WordPress images, start with the pictures visitors actually download on an important page. Reducing an upload's dimensions, compressing its file and selecting the right displayed version solve different problems. Work on a few representative images first so you can compare speed and quality before changing the whole library.

Time: 30-60 minutes Level: Beginner
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

Work with the image visitors actually receive

The image you upload and the file a visitor downloads are not always the same size. WordPress creates alternative versions, and your page builder chooses which one to display. Start with an image on a real page, then check its dimensions, visual quality and delivered file before applying the same approach to a whole library.

Choose the page and images worth improving first

Pick a homepage, service page or product page that matters to visitors. Run its public address through PageSpeed Insights and expand the image-related findings. Record the named image URLs and their reported transfer sizes. A large original in the Media Library is not proof that the browser downloads that original on every page.

Open Media > Library and select a reported image to inspect its dimensions and file size. Keep an untouched copy outside WordPress before editing. Include a detailed photograph, an image containing fine edges and a product image with zoom in your sample. A single compression setting does not suit every visual equally.

Resize the source for its intended use

Find the widest place the image appears in your design, including product zoom or a lightbox. A picture displayed in a small content column does not need the same dimensions as a full-width banner. For example, a 600-pixel-wide image in the layout needs a 1200-pixel-wide source to supply two image pixels per layout pixel on a 2x-density display. Allow for any larger zoom use and compare on the devices your audience uses; that example is not a universal width.

For an existing attachment, open it in the Media Library, choose Edit Image and use Scale Image. Enter the intended width, let the height follow the image's proportions, then select Scale and save any remaining edits. WordPress documents the controls in its media editing guide. Because one attachment can be reused across the site, test a separate copy when you are unsure where the original appears.

Before uploading a new image, resize a copy in your image editor. Crop only when the design needs a different shape, and check that faces, product labels or other essential details remain visible on mobile. Enlarging a small source adds pixels without recovering missing detail, so return to a higher-quality original when the image is already blurry.

WordPress image editor with Scale Image dimensions and a Scale button
Scale Image changes the source dimensions; the thumbnail options control where edits apply. This official 2023 example uses demonstration dimensions, so enter the size your own layout needs. Credit: WordPress Documentation Team, CC0.

Compress a copy and compare it visually

Compression reduces the data needed to store the image. Lossy compression trades some detail for a smaller file; lossless compression preserves pixel information, with the achievable reduction depending on the image and format. Use an image editor you already know or Squoosh to open a copy, compare formats and quality settings, and download the result.

Compare the original and exported file at the size visitors will see, then inspect fine text, edges and gradients more closely. Reduce quality gradually and stop when the change becomes unacceptable for the image's purpose. Record the resulting file size alongside that visual check instead of aiming for an arbitrary byte limit on every image.

Use a format suited to the content. Photographs can work well as JPEG, WebP or AVIF, while transparency and sharp graphics need their own comparison. Simply renaming a .png file to .webp does not convert it. Keep the original so you can re-export if the chosen compression damages product detail.

Confirm format support before converting the library

WordPress supports AVIF from version 6.5 when the host's image-processing software supports it. Open Tools > Site Health > Info > Media Handling and check the supported formats. The WordPress AVIF guidance explains the hosting requirement. Support for uploading a format does not automatically convert the existing library.

Upload one sample and verify that WordPress creates the sizes your site needs. Check it in the editor, on the public page and in a product gallery if relevant. If an optimisation service supplies alternative formats or a fallback, follow its documented delivery method and test that route too. Do not delete the original files until you know how restoration works.

Choose the right image version in the page builder

Edit the page and select the image. In Elementor's Image widget, review Image Resolution in the Content controls and choose an appropriate generated size instead of Full when the design does not need the original. The Image widget guide explains that setting. Changing only the visible width does not establish which file the browser downloads.

In the WordPress block editor, inspect the Image block's resolution and dimensions settings. Keep a sensible aspect ratio so space is reserved before the image loads. Background images and sliders have separate controls, so inspect the component actually supplying the reported image rather than only the Media Library attachment.

Leave the main image visible at the top of the page available promptly. Images further down can load as the visitor approaches them. Our lazy-loading guide explains how to check this without delaying the page's main content. Google's image performance guidance covers dimensions and loading priority.

Apply a proven workflow to the rest of the site

For a small library, upload the optimised copies and select them in the relevant pages. Bulk optimisation needs one maintained tool with documented backups or restoration; try a small batch on a staging copy first. Review its costs, remote-processing behaviour and format delivery before starting a large job.

After updating the page, clear the relevant caches and rerun the same performance test. Confirm the browser now receives the intended image, then inspect desktop, mobile and product zoom. If image bytes fall but the page remains slow, use our Core Web Vitals guide to identify the next measured issue rather than compressing until the pictures look poor.

Get help with the next step

If images still load slowly after resizing and compression, BugShield can help check which files the page actually serves and whether the builder or delivery settings need attention.

Questions answered

How to optimise WordPress images FAQs

Is there one ideal file size for every image?

No. A small decorative image and a detailed product zoom have different requirements. Compare transferred bytes, displayed quality and the image's role rather than applying one limit to the entire library.

Does making an image narrower in Elementor reduce its file size?

Changing its visible width alone does not prove a smaller file is delivered. Review Image Resolution and verify the public page's downloaded image after clearing the relevant cache.

Will WordPress convert my old images to AVIF automatically?

AVIF upload support does not automatically convert the existing library. Conversion and delivery need a separate, tested workflow, and the host must support processing the format.

Should I delete the original images after compression?

Keep originals until the visual quality, all page uses and restoration method have been verified. A backup outside the optimised library gives you a way to re-export damaged images.

Should the homepage's main image use lazy loading?

Do not delay the image visitors need immediately. Reserve lazy loading for suitable off-screen images and check the actual page, since a background or slider can have separate loading behaviour.

Need a hand with your WordPress site?

Tell us what happened and where you got stuck. A BugShield developer can help you work out the next step and confirm a price for the fix.

Explore help with this issue

Accessibility settings

Adjust how this site looks and moves. Your choices are saved in this browser.