Compression5 min read·Updated

How to Compress Images for WordPress (Before and After Upload)

Before uploading to WordPress, resize photos to the width they are displayed at (1200–1600 px for content, up to 2560 px for full-width images) and compress them to roughly 100–300 KB as JPEG quality 75–85. WordPress then scales anything over 2560 px into a “-scaled” copy and saves its generated sizes at JPEG quality 82, but it never recompresses the file you uploaded, so an oversized original stays oversized.

What does WordPress do to an image when you upload it?

WordPress keeps your original file exactly as uploaded and creates several resized copies from it. Since WordPress 5.3, if the longest side is over 2560 px, it also creates a -scaled version (for example photo-scaled.jpg) capped at 2560 px and uses it as the “full” size, while the untouched original stays on the server. Every generated copy is saved at JPEG quality 82 (WebP copies at 86 since WordPress 6.1). Your original is never recompressed.

WordPress core image sizes. Thumbnail, Medium and Large can be changed in Settings > Media; themes and plugins add their own.

Size nameMaximum dimensionsTypical use
Thumbnail150 × 150 px (cropped)Galleries, media grid
Medium300 × 300 pxSmall inline images
Medium Large768 px wideResponsive srcset on tablets
Large1024 × 1024 pxContent images in many themes
1536 × 15361536 pxsrcset on high-density screens
2048 × 20482048 pxsrcset on large high-density screens
Scaled2560 pxReplaces the original as the full size when the upload is bigger

So one 4000 px photo becomes up to eight files before your theme adds any sizes. The copies are reasonably compressed; the problem is the original. If you upload a 2400 px JPEG exported at maximum quality, it is under the threshold, so WordPress serves that multi-megabyte file whenever a theme, block or lightbox asks for the full size.

What is the maximum upload size in WordPress, and where do I see it?

The limit comes from your host's PHP settings, not from WordPress: the smaller of upload_max_filesize and post_max_size, often somewhere between 2 MB and 128 MB. To read it, open Media > Add Media File (Add New Media File or Add New in older versions): the upload screen shows “Maximum upload file size” under the drop zone. Tools > Site Health > Info > Media Handling lists the same value as “Max size of an uploaded file”. If a photo is over the limit, resizing it to 2560 px and compressing it is faster than asking your host to raise it; see fix “image too large to upload”.

Should I compress images before uploading or use a plugin?

Compressing before upload is the cleaner option for most sites: WordPress never touches the original, so it is the only way to control the file served at full size, and it needs no plugin and no account with an optimization service. Plugins are useful when you inherit a large existing media library or many authors upload straight from their phones. Avoid doing both with lossy settings: compressing an already compressed JPEG again costs detail for little gain. If your goal is WebP rather than smaller JPEGs, follow WebP for WordPress or WebP for WooCommerce instead.

How do I compress images before uploading to WordPress?

  1. Open the image compressor and drop your photos (up to 100 at a time). They are processed in your browser and never uploaded.
  2. Keep the output on Same as original so JPG stays JPG and PNG stays PNG.
  3. Turn on Limit width and enter 1600 for content images or 2560 for full-width images. Smaller images are never upscaled.
  4. Set Quality to 75–85 for photos, or switch to Target size and type a limit such as 200 KB.
  5. Download the files and upload them in Media > Add Media File. WordPress builds its thumbnails from your lighter original.
Stay at or under 2560 px
An upload no wider or taller than 2560 px gets no -scaled copy, so the file you compressed is exactly the one WordPress uses as the full size. It also leaves one less large file on your server.

What size and file size should WordPress images be?

Guidelines for JPEG photos at quality 75–85; PNG graphics vary more.

ImageUpload widthTarget file size
Full-width hero or cover1920–2560 px200–400 KB
Featured image1200–1600 px100–250 KB
Image inside a post1200–1600 px80–200 KB
Gallery image1200–1600 px80–200 KB
WooCommerce product photo1200–2000 px, square100–300 KB
Logo or icon (PNG or SVG)2× its displayed widthUnder 50 KB
Want every photo under 200 KB? Type the size and the tool picks the quality for each one.

Does WordPress convert images to WebP automatically?

Not by default. WordPress has accepted WebP uploads since 5.8 and AVIF since 6.5, and generated sizes keep the format you uploaded unless a plugin or the image_editor_output_format filter changes it. Converting every JPEG to WebP was planned for WordPress 6.1 and removed before release. Since 6.7, iPhone HEIC uploads are converted to JPEG when the server's ImageMagick supports HEIC. WordPress 7.1 moved resizing into the browser in Chrome and Edge, with the same 2560 px threshold and 82 quality default, and falls back to the server elsewhere.

In short, what you upload decides most of the page weight. Resize and compress first with Compress JPG, and check the widths your theme actually displays in recommended image sizes for the web.

Put it into practice

Compress your images right now: keep the format or set a target size, free and privately in your browser.

Open the compressor

Frequently asked questions

WordPress saves its generated image sizes at quality 82 for JPEG and 86 for WebP. Developers can change it with the wp_editor_set_quality filter. The original upload is not recompressed.

Upload images that are 2560 px or smaller on their longest side. Developers can also return false from the big_image_size_threshold filter, but resizing before upload saves server space as well.

Each upload is stored as the original plus up to seven core sizes, and themes and plugins add more. Large, uncompressed originals are usually the biggest share, so compressing before upload shrinks the folder the most.

Not if you resize and compress images before uploading and your library is small. A plugin helps with an existing library of heavy images or when many people upload straight from their phones.

Keep reading

Tutorial8 min read

WebP for WordPress

Step-by-step guide to converting and uploading WebP images to WordPress, fixing upload errors, handling fallbacks and speeding up your site without extra plugins.

Read more
Tutorial6 min read

Resize images for web

Exact recommended pixel widths for hero images, blog photos, thumbnails, Open Graph and social media, plus how to resize and convert to WebP in one step.

Read more
Performance6 min read

Compress JPG

A second JPEG pass looks worse. Convert JPEG to WebP once at 80% from the best master you have.

Read more