Compress Images for Website Speed and WordPress
Learn how to prepare smaller images for website speed, WordPress galleries and mobile visitors without sacrificing important visual detail.
Why image size matters on a website
Large images can slow down a page, particularly on mobile connections. A high-resolution photograph from a camera can contain far more pixels than a product card or article actually displays. Sending those extra bytes costs time without necessarily making the page look better. The goal is not to create the smallest possible image. It is to deliver a file that is visually suitable for its display size and practical for visitors to load. Start with the most prominent images, then look at galleries and thumbnails.
Measure the display size first
Inspect the layout at mobile and desktop widths. A small card image and a full-width hero image do not need the same dimensions. Prepare a separate copy for each meaningful display size if the site can serve responsive images. Keep enough detail for high-density screens, but do not automatically upload the original camera file as the only version. In HTML, specifying width and height can also help reserve layout space while images load.
Pick a useful format
For an ordinary photograph, compare JPG and WebP at the same dimensions and inspect the result. WebP often provides a smaller file for comparable visual quality, but the result depends on the image. For logos, screenshots and graphics, PNG or WebP with transparency may be better. Keep the original design asset separately so that you can edit it later. Avoid using a photograph as a substitute for text that should be readable, selectable and accessible on the page.
Compress images for WordPress
Before uploading a new image to WordPress, resize it to a sensible maximum width and choose an output format that your installation and theme support. WordPress commonly creates multiple image sizes, but the uploaded source may still be large. Check which image is actually served on the page, and test the website after the upload. Back up your media library before making bulk changes. Do not overwrite original files if you need them for print or future design work. You can use 4IMG to process individual files or a small batch before uploading them.
Use performance measurements instead of guessing
A smaller image does not automatically fix every speed problem. Slow server responses, scripts, fonts and layout shifts can also affect the visitor experience. Test important pages with PageSpeed Insights and review Largest Contentful Paint, Interaction to Next Paint and Cumulative Layout Shift where data is available. Compare measurements before and after a change. Load images below the fold lazily when appropriate, but do not blindly delay the main image that users need to see immediately.
A practical publishing routine
Keep an original copy outside the public media folder. Resize the working copy to the intended display dimensions, select JPG or WebP as appropriate, then compress it and inspect the preview. Give it a descriptive filename and write useful alternative text when the image conveys information. Upload it, verify that the actual page loads the intended image, and check both a phone-sized viewport and a desktop viewport. Repeat the process for new content rather than running the same lossy compression on an already optimized file every week.
Try the image compressor, batch compressor or image converter.
Further reading: Core Web Vitals and PageSpeed Insights.