New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Images

Learn how to optimize WordPress images.

Oversized uploads are the most common WordPress performance mistake. A 4000px hero uploaded from a phone becomes multiple thumbnails and slows every page. This guide covers compression, sizing, and delivery without ruining WooCommerce product detail.

Time: 30-60 minutes Level: Beginner
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

What this problem looks like

WordPress generates several sizes per upload. One careless 5 MB PNG can produce a megabyte of thumbnails across sizes. Optimisation starts at upload discipline, then automation.

WooCommerce product galleries need enough resolution for zoom. Compress aggressively on blog images, more carefully on primary product photos.

Step 1: Set maximum upload dimensions

WordPress 5.3+ scales down huge uploads, but themes may still request full size. Add limits in your child theme functions.php or use a plugin to cap upload width at 2000px for heroes and 1500px for inline content unless you sell art prints.

php
add_filter( 'big_image_size_threshold', function() {
	return 2048;
} );

Step 2: Choose a compression plugin

  • ShortPixel: strong WebP and AVIF, good WooCommerce support.
  • Imagify: integrates with WP Rocket.
  • EWWW: local compression option for privacy-sensitive shops.
  • Smush: easy bulk smush for blogs and brochure sites.

Step 3: Use modern formats with fallbacks

WebP and AVIF cut bytes dramatically. Enable <picture> tag delivery or server content negotiation. Keep JPEG originals until you verify Safari and older browsers in your analytics.

Step 4: Regenerate thumbnails after theme change

New themes register new image sizes. Old thumbnails stay at wrong dimensions until regeneration. Use Regenerate Thumbnails or WP-CLI after switching themes.

The command below needs SSH access and will not work inside File Manager:

bash
wp media regenerate --yes

Step 5: Lazy load and priority hints

WordPress lazy loads images by default. Do not lazy load the LCP hero. Use fetchpriority="high" on the main above-fold image in block themes or your template.

When to stop DIY and hire help

Large catalogs, custom image pipelines, or print-on-demand shops need tuned rules per category. BugShield optimises WooCommerce media without breaking zoom or colour accuracy at a confirmed price without hourly billing surprises.

Questions answered

WordPress image optimisation FAQs

Answers about image dimensions, compression, WebP and AVIF, responsive sizes, lazy loading, accessibility, and improving existing media.

What image size should I upload to WordPress?

Upload close to display size. Heroes rarely need more than 1920px wide. Product images depend on zoom level, often 1200 to 2000px.

Does WebP work with WooCommerce?

Yes with modern optimisation plugins. Test checkout and product gallery on iOS Safari before bulk conversion.

Will optimising images hurt SEO?

No. Faster pages help SEO. Keep descriptive alt text and filenames.

Should I use a CDN for images?

Yes on traffic-heavy sites. Cloudflare, Bunny CDN, or plugin CDNs reduce origin load and improve global TTFB for media.

Which image format is best for WordPress?

Use JPEG, WebP, or AVIF for photographs, PNG when transparency or lossless detail is needed, and SVG only from trusted sources for suitable graphics.

Should I resize images before uploading to WordPress?

Yes. Export close to the largest displayed dimensions so WordPress does not store and deliver an unnecessarily large original.

How much should I compress WordPress images?

Use enough compression to reduce file size without visible damage at the displayed size. Compare representative mobile and desktop screens before applying bulk settings.

How do WordPress responsive image sizes work?

WordPress creates alternate sizes and adds srcset and sizes attributes so the browser can choose an appropriate file for the layout.

Should the main above-the-fold image be lazy loaded?

Usually not. A likely Largest Contentful Paint image should load promptly and may need preload or fetch-priority hints instead of lazy loading.

Can I optimise images already in the WordPress Media Library?

Yes. Back up originals, run a trusted bulk optimiser, regenerate required thumbnail sizes, and check galleries, product zoom, crops, and visual quality.

Would you rather a developer fixed it?

Request a fix at a confirmed price and speak directly with the BugShield developer working on your site.

Request a Fix