CompressImg
Guide··9 min read

How to Compress Images for WordPress — Speed Up Your Site Without Losing Quality

Uncompressed images are the single most common cause of slow WordPress sites. A single hero image uploaded straight from a smartphone camera can be 5–15MB — enough to push your LCP (Largest Contentful Paint) past Google's 2.5-second threshold and directly hurt your search rankings. This guide covers exactly how to compress images before uploading to WordPress, what sizes to target, how WebP works in WordPress, and the mistakes that silently slow down most sites.

Why Image Compression Matters for WordPress

Images account for 50–80% of page weight on most WordPress sites. When a visitor loads a page, the browser must download every image before it can fully render the content. Large images mean longer download times — and longer download times mean higher bounce rates, lower engagement, and lower search rankings.

Google's Core Web Vitals score includes LCP (Largest Contentful Paint), which measures how long it takes for the largest visible element — usually a featured image or hero photo — to load. Sites with LCP under 2.5 seconds are rated "Good." Sites above 4 seconds are rated "Poor" and face ranking penalties.

Image StateTypical File SizeLoad Time (4G)LCP Rating
Straight from camera (12MP)3–8 MB2–6 seconds❌ Poor
WordPress resized, uncompressed original500KB–2MB0.5–2 seconds⚠️ Needs improvement
Pre-compressed at Q80, 1200px80–200KB0.1–0.3 seconds✅ Good
Pre-compressed WebP at Q80, 1200px50–140KB0.05–0.2 seconds✅ Good

What Happens When You Upload an Image to WordPress

When you upload an image through the WordPress Media Library, WordPress does two things automatically:

  1. 1.Saves the original file as-is. The full-resolution image you uploaded is stored in wp-content/uploads/ unchanged. If you upload a 6MB iPhone photo, that 6MB file stays on your server permanently.
  2. 2.Generates resized versions at JPEG quality 82. WordPress automatically creates thumbnail (150×150px), medium (300×300px), large (1024×1024px), and medium-large (768px wide) sizes from the original. These are saved at JPEG quality 82 — decent, but not optimal.

The problem with this approach

WordPress generates intermediate sizes from your original file. If you upload a 6MB photo, WordPress's "large" size (1024px wide at quality 82) will be 100–300KB — but the original 6MB file is still sitting on your server, consuming storage and sometimes served directly by themes that use full image size. Pre-compressing before upload means WordPress generates all its sizes from an already-optimized source.

How to Compress Images Before Uploading to WordPress

The most reliable method is to compress images client-side before they ever reach your WordPress media library. This gives you control over the output quality and file size — and means you are not relying on WordPress or a plugin to do it correctly.

  1. 1

    Resize to the maximum display width first

    Check your WordPress theme's content width. Most themes have a content area 600–1200px wide. Use the Resize Image tool to bring your image to 1200px wide (or your theme's max content width) before compressing. Uploading a 4000px image to a 1200px column wastes 3× the file size for no visual benefit.

  2. 2

    Compress at quality 80

    Upload the resized image to CompressImg and set the quality slider to 80. This matches WordPress's internal quality setting (82) but on an already correctly-sized image. At quality 80, a 1200px wide photo typically compresses to 80–180KB — fast to load and visually sharp.

  3. 3

    Upload the compressed image to WordPress

    Download the compressed file and upload it to your WordPress Media Library. You will see the file size is already a fraction of the original — and all the WordPress-generated intermediate sizes will be generated from this leaner source.

Recommended Image Dimensions and File Sizes for WordPress

The right dimensions depend on where the image appears in your WordPress theme. Uploading a 3000px image to a sidebar widget or a 600px blog post column adds unnecessary file size with no quality benefit — WordPress will scale it down to display size anyway.

Image UseRecommended WidthQualityTarget File Size
Full-width hero / banner1920pxQ75–80100–250KB
Featured image (post thumbnail)1200pxQ8080–180KB
Blog post body images800–1000pxQ8050–120KB
Product images (WooCommerce)800×800pxQ8060–150KB
Sidebar widgets / thumbnails400–600pxQ7520–60KB
Author avatar / profile300×300pxQ8015–40KB
Logo (PNG with transparency)300–600pxQ100 PNG10–50KB

How to find your theme's content width: In Chrome, right-click on a content image in your WordPress posts and select "Inspect." The element's computed width shows the actual display size. Upload images at that width — not wider.

WebP in WordPress: 25–35% Smaller Files

WordPress has supported WebP image uploads natively since version 5.8 (July 2021). If you upload a WebP image, WordPress generates all its intermediate sizes (thumbnail, medium, large) in WebP format. Modern browsers — Chrome, Firefox, Safari 14+, Edge — all support WebP, covering over 95% of web users as of 2026.

The practical benefit: a 1200px wide photo that is 150KB as JPEG is typically 90–110KB as WebP at the same visual quality. Multiply that across 20–30 images on a page and the difference is measurable in LCP scores.

Convert JPG to WebP before uploading

Use the JPG to WebP converter to convert your compressed JPG to WebP format. Then upload the WebP file to WordPress. All intermediate sizes WordPress generates will also be WebP.

Check plugin compatibility

Most modern WordPress themes and page builders (Elementor, Divi, Gutenberg blocks) display WebP correctly. Older image gallery plugins may show broken images. Test with one WebP image before switching fully.

Common WordPress Image Mistakes — And How to Fix Them

Uploading camera photos directly without resizing

Fix: A 12MP phone photo at 4032×3024px is unnecessary for any WordPress content area. Resize to 1200px wide first. This alone reduces a 5MB photo to 400–800KB before any quality compression.

Using PNG for photographs

Fix: PNG uses lossless compression, which makes it ideal for logos and graphics but terrible for photos. A photograph saved as PNG can be 3–5× larger than the same photo as JPG at quality 80. Use the Convert Image tool to switch format before uploading.

Relying on WordPress plugins to compress after upload

Fix: Plugins like Smush or ShortPixel compress images after they reach your server — but the original uncompressed file is already stored in uploads/. Pre-compressing before upload gives you control over the source quality and avoids storing unnecessarily large originals.

Using the same image for desktop and mobile

Fix: WordPress generates responsive srcset automatically, but only if you upload an image larger than the display sizes. If you upload a 1200px image, WordPress generates smaller sizes for mobile automatically. If you upload a 600px image, mobile users get no smaller option.

Not setting alt text on compressed images

Fix: Alt text is an SEO signal — it tells Google what the image contains. Compressing images improves performance, but SEO also requires descriptive alt text. Always fill in the Alt Text field in the WordPress Media Library after uploading.

The 3-Minute WordPress Image Optimization Workflow

Here is the exact process to follow every time you prepare an image for WordPress:

1. Identify the display context

Is this a hero image (full width), a featured post image, or a body image? Each has a different target width. When in doubt, 1200px covers 90% of WordPress themes.

2. Resize to max display width

Use the Resize Image tool to set the width. Lock aspect ratio so the height scales automatically. Download the resized file.

3. Compress at quality 80

Upload the resized image to CompressImg. Set quality to 80. Check the output file size — it should be under 200KB for a 1200px image. If it is over 200KB, the image has very high detail (fine textures, lots of small objects) — try quality 70.

4. (Optional) Convert to WebP

Download the compressed JPG, then upload it to the JPG to WebP converter. Download the WebP version. WebP will be 20–30% smaller than the already-compressed JPG.

5. Upload to WordPress Media Library

Upload the compressed (and optionally WebP-converted) image. WordPress generates all intermediate sizes from this optimized source. Fill in the Alt Text field before inserting into content.

JPG vs PNG vs WebP for WordPress — Quick Reference

FormatBest ForFile SizeTransparencyUse in WordPress
JPGPhotos, hero imagesMediumNoDefault for photos
PNGLogos, icons, screenshotsLarge (lossless)YesLogos and graphics only
WebPPhotos + graphicsSmall (25–35% < JPG)YesBest choice (WP 5.8+)

Free Tools for WordPress Image Optimization

Frequently Asked Questions