On most websites, images make up the biggest share of page weight. A single photo straight from a modern phone can be several megabytes, more than the rest of the page combined. Optimizing images is one of the easiest, biggest speed wins available, and it doesn't require any coding.
Why image optimization matters
- Faster loading, especially on mobile connections
- Better Core Web Vitals, since the largest element on many pages is an image. See Core Web Vitals explained
- Less storage and bandwidth used on your hosting plan
- Lower data use for your visitors
Step 1: Choose the right format
| Format | Best for | Notes |
|---|---|---|
| WebP | Photos and graphics | Usually much smaller than JPEG or PNG at similar quality. Supported by all modern browsers. |
| AVIF | Photos | Often even smaller than WebP. Modern browser support is good, but encoding is slower. |
| JPEG | Photos | Universal fallback. |
| PNG | Graphics needing transparency, screenshots with text | Lossless and often large for photos. |
| SVG | Logos, icons, simple illustrations | Vector, so it's sharp at any size and often tiny. |
| GIF | Simple animations | Usually large. A short video or animated WebP is usually much smaller. |
Rule of thumb: use WebP for photos and most graphics, SVG for logos and icons, and PNG only when you really need lossless quality.
WordPress supports uploading WebP images, and many optimization plugins can create WebP versions of existing JPEGs and PNGs automatically.
Step 2: Resize to the size you actually display
If your blog's content area is 800 pixels wide, uploading a 4,000-pixel-wide photo wastes bandwidth. The browser downloads it all, then shrinks it.
- Full-width hero images: around 1,600 to 2,000 px wide is usually plenty.
- Content images: around 1,200 px wide covers most layouts, including high-density screens.
- Thumbnails: match your theme's thumbnail size.
WordPress automatically creates several sizes when you upload an image, and uses srcset to let browsers pick the right one. It also scales down very large uploads. But starting with a sensibly sized original keeps your storage tidy and makes everything faster.
Step 3: Compress
Compression removes data your eyes won't miss.
- Lossy compression (JPEG, WebP, AVIF) reduces file size a lot by discarding fine detail. A quality setting around 75 to 85 usually looks identical to the original on screen.
- Lossless compression (PNG, lossless WebP) keeps every pixel but saves less.
How to compress:
- Before uploading, using a free desktop or web-based image compressor
- Automatically in WordPress with an image optimization plugin. On LiteSpeed servers, the LiteSpeed Cache plugin includes an image optimization service. See speed up WordPress with LiteSpeed Cache.
Aim for most content images to be under about 200 KB, and hero images under about 300 to 400 KB. These are guides, not rules. Judge by how they look.
Step 4: Lazy-load images below the fold
Lazy loading means images further down the page only load as the visitor scrolls towards them. The page appears faster, and visitors who never scroll don't download images they never see.
- Modern browsers support it natively with
loading="lazy"on<img>tags. - WordPress adds it automatically to most images in content.
- Caching and optimization plugins can extend it to more images and iframes.
Important: don't lazy-load the main image at the top of the page. It delays your Largest Contentful Paint. Most modern WordPress versions skip lazy-loading for the first large image, but check if you use a page builder or plugin.
Step 5: Always set width and height
When an image has width and height attributes, the browser reserves the right amount of space before it downloads. Without them, content jumps around as images load, which harms your CLS score.
WordPress adds dimensions automatically for images inserted through the editor. Check custom HTML, page builder widgets and theme options.
Step 6: Use descriptive file names and alt text
This doesn't speed up your site, but it helps accessibility and search:
- File names:
blue-ceramic-coffee-mug.webpis better thanIMG_4032.jpg. - Alt text: describe what the image shows, for people using screen readers and for search engines. Keep it short and specific. Decorative images can have empty alt text.
Step 7: Don't host video files on your website
Upload videos to a video platform and embed them. Self-hosted video files are huge, use a lot of bandwidth and storage, and won't stream as smoothly. For embeds, use a "lite" embed or facade that only loads the full player when someone clicks play.
A quick workflow for every new image
- Resize to the display size.
- Export as WebP (or JPEG), at quality around 80.
- Name the file descriptively.
- Upload, and add alt text.
- Let WordPress handle
srcsetand lazy loading.
Fixing an existing site full of big images
- Install an image optimization plugin and run a bulk optimization. Back up first.
- Turn on WebP conversion if the plugin offers it.
- Find the biggest offenders in a speed test's report (look for "Properly size images" and "Serve images in next-gen formats").
- Replace oversized hero images with resized versions.
- Re-test. See how to test your website speed.
The bottom line
Choose WebP for photos, SVG for logos, resize to the display size, compress, lazy-load below the fold and always set dimensions. Do that, and images go from your site's heaviest burden to a fast, sharp part of the experience.