Originally published: March 15, 2025 · Last reviewed and updated: October 2026
Images are usually the heaviest part of a WordPress page, and often the largest element a visitor sees first. That makes them one of the easiest ways to improve page speed and Core Web Vitals. The good news is that WordPress now does a lot of the work for you: it scales down huge uploads, creates several sizes for each image, lazy-loads images below the fold, and supports WebP and AVIF.
This guide explains how to optimize images for WordPress in 2026. It covers what core already handles, what you should do before uploading, which formats to use, and when a plugin or image CDN is worth it.
The Short Answer
- Resize images to the largest size your theme actually displays, usually 1,200 to 2,000 pixels wide, before you upload them.
- Compress them. Use WebP for most photos, and AVIF where your server supports it.
- Always fill in the alt text.
- Let WordPress handle responsive sizes and lazy loading, and don’t lazy-load the main image at the top of the page.
- Add an optimization plugin or image CDN if you upload a lot of images or need to convert an existing library.
What WordPress Core Already Does
| Feature | What it does | Since |
|---|---|---|
| Big image scaling | Uploads larger than 2,560 px are scaled down; the original is kept | WordPress 5.3 |
| Responsive images | Adds srcset and sizes so browsers pick a suitable size | WordPress 4.4 |
| Native lazy loading | Adds loading="lazy" to images; the first content image is skipped | 5.5, improved in 5.9 |
| Fetch priority | Adds fetchpriority="high" to the likely LCP image | WordPress 6.3 |
| WebP support | Upload and use WebP images | WordPress 5.8 |
| AVIF support | Upload and use AVIF if the server’s image library supports it | WordPress 6.5 |
The 2,560-pixel limit comes from the big_image_size_threshold filter. Developers can raise it, lower it, or disable it. The lazy-loading and priority rules are described in the core team’s posts on lazy loading in 5.9 and image performance in 6.3.
Before You Upload: Size and Compress
Core features help, but they cannot fix an image that is far bigger than it needs to be.
- Resize to the display size. If your content column is 800 px wide, a 1,600 px image covers high-density screens. A 6,000 px camera photo only wastes storage and processing time.
- Crop to the aspect ratio you need. That avoids the theme cropping important parts of the picture.
- Compress. Free tools such as Squoosh let you compare quality and file size side by side.
- Use descriptive file names.
wordpress-media-settings.webpis clearer to people and search engines thanIMG_4821.jpg.
Choose the Right Format
| Format | Use it for | Notes |
|---|---|---|
| WebP | Most photos and screenshots | Much smaller than JPEG at similar quality; supported by all modern browsers |
| AVIF | Photos where you want the smallest files | Up to 50% smaller than JPEG; encoding is slower and the server needs AVIF support |
| JPEG | Fallback for photos | Universal, but larger than WebP or AVIF |
| PNG | Images that need lossless quality or transparency | Usually large; consider WebP with transparency instead |
| SVG | Logos and icons | Scales without loss; upload only SVGs from trusted sources, because they can contain code |
The core team’s AVIF announcement explains how to check support under Tools → Site Health → Info → Media Handling: GD or Imagick must list AVIF. To have WordPress convert uploads automatically, a developer can use the image_editor_output_format filter, or you can use a plugin that does it for you.
Write Useful Alt Text
Alt text is read by screen readers and helps search engines understand an image. Describe what the image shows and why it is there, in a short sentence. Leave the alt text empty only for purely decorative images. Do not stuff keywords into it.
Lazy Loading and the LCP Image
Lazy loading saves bandwidth for images further down the page. However, the main image at the top of a post is often the Largest Contentful Paint element, and lazy-loading it slows the page down. WordPress already skips the first content image and marks the likely LCP image with fetchpriority="high". Problems usually come from themes or plugins that add their own lazy-loading to every image. Google’s guide to browser-level lazy loading explains the trade-off.
Our guide to WordPress lazy load implementation covers custom setups, and the INP guide covers the other Core Web Vitals.
When to Use a Plugin or Image CDN
A plugin is worth it if you:
- Have hundreds of existing JPEG or PNG images to convert to WebP or AVIF.
- Want compression to happen automatically on upload, so authors do not need to remember it.
- Need to serve different formats depending on browser support.
Well-known options include Smush, ShortPixel, Imagify, EWWW Image Optimizer, and Optimole. Most offer a free tier with a monthly limit. Use only one image optimization plugin at a time, and test it on staging first.
An image CDN resizes and converts images on the fly and serves them from servers close to your visitors. It suits image-heavy sites. Our CDN setup guide explains how to add one.
Common Mistakes
- Uploading straight from a camera or phone. Even with scaling, this wastes storage and slows uploads.
- Lazy-loading the hero image. This is one of the most common causes of a slow LCP.
- Running two optimization plugins. They can double-compress images or fight over the same files.
- Converting without a backup. Bulk conversion changes thousands of files; back up the uploads folder first.
- Forgetting alt text. It is an accessibility requirement, not an optional SEO extra.
- Using PNG for photos. PNG photos are often several times larger than WebP.
FAQ
What is the best image size for a WordPress blog post?
Match the widest size your theme displays, then double it for high-density screens. For most blogs that means 1,200 to 2,000 pixels wide, compressed to well under 200 KB.
Should I use WebP or AVIF?
WebP is the safe default: it is supported everywhere and is fast to encode. AVIF gives smaller files, but your server must support it and encoding takes longer. Many sites serve AVIF with a WebP or JPEG fallback.
Does WordPress compress images automatically?
WordPress re-compresses the extra sizes it creates (the default JPEG quality is 82). It does not deeply optimize the original file, so compressing before upload or using a plugin still helps.
Do image optimization plugins slow down my site?
The optimization runs when you upload or in the background, so visitors do not see the extra work. Plugins that rewrite every image URL on the fly add a small cost, so test before and after.
How do I find the images slowing my site down?
Run a test in PageSpeed Insights and look at “Properly size images”, “Serve images in next-gen formats”, and the LCP element. Our page speed optimization guide explains how to read the results.
The Bottom Line
To optimize images for WordPress, resize and compress before upload, use WebP or AVIF, and write real alt text. Let core handle responsive sizes, lazy loading, and fetch priority. Add a plugin or image CDN only when you have a large library to convert or want the process to be automatic. Then test the result with PageSpeed Insights.
Sources & Further Reading
- WordPress Developer Resources: big_image_size_threshold
- WordPress Developer Resources: image_editor_output_format
- Make WordPress Core: WordPress 6.5 adds AVIF support
- Make WordPress Core: Enhanced lazy-loading performance in 5.9
- Make WordPress Core: Image performance enhancements in WordPress 6.3
- web.dev: Browser-level image lazy loading
- web.dev: Largest Contentful Paint
- Learn WordPress: WebP images in WordPress
Articles are editorially reviewed by Jackober and factual claims are checked against cited sources.
1 comment