Guide

How to Compress Images for WordPress (Without Plugins)

Updated March 2026 · 8 min read

By CompressLocal Team

Images are the #1 reason WordPress sites load slowly. The average WordPress page serves 1-3 MB of images alone. Plugins like Smush or ShortPixel can help, but they add overhead to your site, require API keys, and often have free tier limits.

There's a simpler approach: compress your images before uploading them to WordPress.

Why compress before uploading?

  • No plugin overhead — compression plugins run on every page load, consuming server resources and adding JavaScript to your frontend.
  • No API limits — most compression plugins have monthly quotas on their free plans (typically 50-100 images/month).
  • Works with any host — shared hosting, managed WordPress, WP Engine, Kinsta — doesn't matter. You're uploading already-optimized files.
  • One-time effort — compress once, upload once. No background processing or queue delays.

How WordPress handles your images internally

When you upload a single image to the Media Library, WordPress doesn't just store that one file. It generates multiple resized versions automatically. By default, WordPress creates a thumbnail (150×150), a medium size (300px wide), a medium-large (768px wide), and a large size (1024px wide). Many themes register additional sizes — a typical theme might create 6-8 versions of every upload.

WordPress then uses the srcset attribute to serve the right size to each visitor. A phone on a 375px viewport gets the 300px version; a desktop on a 1440px monitor gets the 1024px version. This is smart — but it only works well if the source image is already optimized.

Here's the problem: if you upload a 4000×3000 pixel photo straight from your camera (typically 5-8 MB), WordPress still stores that original at full size. It compresses the resized copies to 82% JPEG quality, but the original stays untouched. That bloated original gets served to visitors on high-resolution displays or when a plugin bypasses srcset. Pre-compressing to 1200-1600px wide and under 200 KB means every generated version starts from an already-lean source.

Recommended image sizes for WordPress

Image typeMax widthTarget file size
Featured image / hero1200px100-200 KB
Blog post content800px50-150 KB
Thumbnails300px20-50 KB
WooCommerce products800-1000px80-150 KB

Step-by-step workflow

  1. Resize your images first. If your WordPress content area is 800px wide, there's no reason to upload a 4000px photo. Resize to match the display size.
  2. Set a target file size. For blog posts, 100-200 KB per image is a good target. Hero images can be up to 200 KB.
  3. Batch compress. Drop all your post images into a compressor at once. Download them individually or as a ZIP.
  4. Upload to WordPress. Go to Media → Add New and upload your compressed images. WordPress will generate its own thumbnails from your already-optimized originals.

What about WordPress's built-in compression?

WordPress does compress JPEG uploads to 82% quality by default. But this only applies to the resized versions WordPress generates — your original upload stays full size in the media library. Pre-compressing means every version is optimized.

WordPress 5.8+ and native WebP support

Since WordPress 5.8 (released July 2021), you can upload WebP images directly to the Media Library without any plugin. WordPress 6.1 went further — it can generate WebP versions of your JPEG and PNG uploads automatically if your server has the required libraries (libwebp via GD or Imagick).

What this means for your workflow: you have two solid options. First, you can compress your images as WebP before uploading. WebP files are typically 25-35% smaller than equivalent-quality JPEGs, so a photo that compresses to 150 KB as JPEG might be just 100-110 KB as WebP. Second, you can upload pre-compressed JPEGs and let WordPress generate WebP copies server-side. Either way, starting from a pre-compressed source ensures the WebP output is as lean as possible. Don't rely on WordPress to do all the heavy lifting — server-side conversion from a 6 MB original still produces unnecessarily large WebP files.

WooCommerce image optimization

WooCommerce stores are especially sensitive to image weight because product pages directly affect revenue. A typical product page loads the main product image, 3-6 gallery thumbnails, and a high-resolution zoom image — that's easily 8-12 image requests per product.

WooCommerce defaults to 600×600 for single product images and 100×100 for gallery thumbnails, but many themes override these to larger sizes. The zoom feature (enabled by default in WooCommerce 3.0+) serves the full-resolution original when a customer hovers over the product image. If that original is an uncompressed 4 MB photo, your customer waits for a 4 MB download just to zoom in.

The business impact is real: Google found that a 1-second delay in mobile page load reduces conversions by up to 20%. For a WooCommerce store doing $10,000/month, shaving 2 seconds off product page load by pre-compressing images could mean $2,000-4,000 in recovered annual revenue. Compress product images to 800-1000px wide and under 150 KB. For zoom, 1600px wide at 200-250 KB gives sharp detail without the multi-megabyte penalty.

Impact on Core Web Vitals

Google uses Core Web Vitals as a ranking signal, and images directly affect the most important one: Largest Contentful Paint (LCP). LCP measures how long it takes for the largest visible element — usually a hero image or featured image — to finish rendering. Google considers an LCP under 2.5 seconds "good" and anything over 4 seconds "poor."

You can measure your LCP using Google PageSpeed Insights (pagespeed.web.dev), Lighthouse in Chrome DevTools (Ctrl+Shift+I → Lighthouse tab), or the Web Vitals Chrome extension for real-time monitoring. Run your homepage and your highest-traffic blog post through PageSpeed Insights — those are the pages Google cares about most.

In practice, pre-compressing images typically improves LCP by 0.5-1.5 seconds on image-heavy WordPress pages. A hero image that drops from 800 KB to 150 KB loads roughly 4× faster on a typical 4G connection (15 Mbps). Combined with proper srcset usage and lazy loading, pre-compression is the single highest-impact optimization most WordPress sites can make without touching code.

Common WordPress image mistakes

  • Not enabling lazy loading — WordPress 5.5+ adds loading="lazy" to images automatically, but some themes or page builders strip it. Check your page source to confirm it's present on below-the-fold images. Without lazy loading, the browser downloads every image on the page upfront, even ones the visitor may never scroll to.
  • Ignoring srcset — if you hard-code image URLs in custom HTML blocks or theme templates, WordPress can't add srcset attributes. Always use wp_get_attachment_image() in PHP or the standard Image block in Gutenberg so WordPress can serve the right size to each device.
  • Uploading uncompressed screenshots — PNG screenshots from a 1440p or 4K display are routinely 2-5 MB each. A single tutorial post with 8 screenshots can weigh 20+ MB. Compress screenshots to PNG at reduced color depth or convert to JPEG at 80% quality — most screenshots look identical at 150-300 KB.
  • Using the wrong format — photos as PNG files are 3-5× larger than necessary. Logos and icons as JPEG get compression artifacts around sharp edges. Match the format to the content: JPEG or WebP for photos, PNG or SVG for graphics with sharp lines and text.
  • Skipping alt text — not a compression issue, but while you're optimizing images, add descriptive alt text. It helps SEO, accessibility, and gives Google context about your images for image search rankings.

Format tips for WordPress

  • Use JPEG for photos and images with gradients
  • Use PNG for screenshots, logos, or images with text
  • Use WebP if your theme and host support it (most modern setups do since WordPress 5.8+)

Compress before you upload — no plugin needed

CompressLocal lets you batch compress up to 20 images at once, right in your browser. Set a target size, drop your files, and download. Nothing ever leaves your device.

Compress for WordPress