21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Optimize Images in WordPress

Quick answer

To optimise images in WordPress, resize each file to the width your layout actually shows, save it as WebP or a well-compressed JPEG, and upload that copy. WordPress already creates smaller sizes, scales uploads above 2,560 pixels and lazy-loads images below the fold; keep the main hero image out of lazy loading.

For bloggers, store owners and agencies whose WordPress pages are slow because of heavy photos, banners and screenshots.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
2 min
Sections
4
Updated
14 Nov 2026
Written by
WebJi® team

What does WordPress already do to images when you upload them?

WordPress creates several resized copies of every upload, compresses JPEGs at quality 82, scales anything wider or taller than 2,560 pixels down to that limit, and adds lazy loading and srcset to the images it outputs. What it does not do is turn a heavy original into a small, well-sized file for your layout.

Built-in WordPress image handling and the version that introduced it
FeatureWhat happensSince
Default sizesThumbnail 150 px, medium 300 px, medium_large 768 px, large 1,024 px (Settings › Media)Long-standing
Big image thresholdUploads above 2,560 px are scaled down; the original is kept beside a "-scaled" copyWordPress 5.3
Responsive srcsetThe browser picks the smallest size that fits the screenWordPress 4.4
Native lazy loadingloading="lazy" on images below the foldWordPress 5.5
WebP / AVIF uploadsAccepted if the server's image library supports them5.8 / 6.5
fetchpriority on the main imageThe likely largest image gets fetchpriority="high"WordPress 6.3

Why should you resize images before you compress them?

Resizing removes pixels the layout never shows, which saves far more weight than compression alone. A 4,000-pixel phone photo placed in an 800-pixel content column carries roughly 25 times the pixels it needs (4,000 × 3,000 against 800 × 600).

Find the widest size your theme actually displays: open the page, right-click the image and inspect its rendered width, then double it for high-density phone screens. For most blog content columns that lands between 1,200 and 1,600 pixels; full-width hero images may need 1,920. Keep the camera original on your computer, because detail cannot be recovered from a small upload.

Which image format should a WordPress site use?

Use WebP for photos and most graphics, keep JPEG as a fallback where an old tool needs it, use PNG only for screenshots that need sharp text or transparency, and SVG for logos and icons. AVIF compresses further than WebP but encodes more slowly and needs a host whose image library supports it.

  • WebP: supported by all current browsers and by WordPress since 5.8; the conversion steps are in converting WordPress images to WebP.
  • JPEG: fine for photos when exported at quality 75–85.
  • PNG: large for photos; use it for UI screenshots and diagrams.
  • SVG: tiny and sharp at any size, but WordPress blocks SVG uploads by default because they can contain scripts; use a sanitising plugin if you need them.

How do you compress new uploads and the existing media library?

Compress new images before upload, then run one compression plugin once across the existing library, and check a real page afterwards. Running two compressors on the same files only degrades quality.

  1. Back up wp-content/uploads or download the originals you may need again.
  2. Resize new images to your column width and export them as WebP or JPEG.
  3. Install one optimisation plugin and run its bulk tool on the library.
  4. Open a post with a large photo and a screenshot; confirm small text is still readable and the layout does not jump.

After changing image sizes in Settings › Media, old uploads keep their old sizes until you regenerate them. With SSH and WP-CLI:

wp media regenerate --only-missing --yes

More techniques for shrinking individual files are in decreasing image file size.

Should every WordPress image be lazy-loaded?

No: lazy-load images below the fold, but never the main image at the top of the page, because delaying it slows Largest Contentful Paint (LCP). WordPress already skips lazy loading on the first content images and marks the likely LCP image with high fetch priority.

Problems usually come from a second lazy-load plugin or a page builder that lazy-loads the hero banner anyway. Remove the duplicate and check the hero's HTML has no loading="lazy". Details and edge cases are in enabling lazy load in WordPress. Add width and height attributes, which WordPress does automatically for images inserted through the editor, so the layout does not shift as images arrive.

How should you write alt text for WordPress images?

Describe what the image shows and why it is on the page, in one short sentence; leave alt empty for purely decorative images. Alt text is what a screen reader speaks and what appears if the file fails to load, and it helps Google Images understand the picture.

Write "Blue cotton kurta with mirror work, front view" rather than "kurta buy online best price kurta". Repeating a keyword in every alt attribute helps neither visitors nor rankings. Set it in the Media Library's Alternative Text field so every reuse of the image inherits it.

What else affects WordPress image speed besides the files?

Delivery matters as much as file size: page caching, a CDN close to your visitors and fast server storage decide how quickly even well-compressed images arrive. A CDN serves images from edge locations, as compared in Cloudflare vs Bunny CDN, and a media library on a CDN takes load off the server.

Images are one part of a slow site; themes, plugins and third-party scripts are the rest. WebJi® WordPress hosting runs on NVMe storage, and the WordPress speed optimisation service handles the whole stack when images are not the only problem.

FAQ

Frequently asked questions

Does WordPress compress images automatically?

Partly. WordPress saves its resized JPEG copies at quality 82 and scales uploads above 2,560 pixels, but it does not convert formats or aggressively shrink the original. A compression step before upload or a single optimisation plugin does the rest.

Why does my media library have so many copies of one image?

WordPress makes one file per registered image size, and themes and plugins often register more. A single upload can produce eight or more files. Remove unused sizes in the theme or plugin settings, then regenerate thumbnails to clear the extra copies.

Will image compression reduce photo quality?

Moderate lossy compression is invisible on most photos; heavy settings blur fine text in screenshots and banners. Test one image of each type, compare at 100% zoom, and keep originals so you can redo any file that looks wrong.

What image size is best for a WordPress featured image?

Match your theme's featured image dimensions, usually listed in its documentation; 1,200 × 630 pixels also suits social sharing previews. Upload at that size rather than a full camera original, and WordPress will generate the smaller copies for archives.

Checked 14 November 2026 against WordPress core release notes · Reviewed by the WebJi® team, Jaipur.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.