Images are usually the heaviest part of a page. A single photo straight from a phone can be 4–8 MB, more than the rest of the page combined. Optimised images improve your Largest Contentful Paint score, use less disk space and make backups faster.
Before you start
- Measure a typical page with PageSpeed Insights and note the warnings about images.
- Check how much space media uses: cPanel → Files → Disk Usage, look at
wp-content/uploads.
Resize before you upload
Most themes never display images wider than 1200–1920 px. Resize photos on your computer before uploading, and use JPEG for photos, PNG only for graphics that need transparency, and SVG for logos (with a plugin that sanitises SVG files). WordPress automatically scales down uploads larger than 2560 px, but it still keeps the original.
Compress and convert to WebP
On MdmHost the simplest option is the image optimisation built into LiteSpeed Cache:
- Go to LiteSpeed Cache → Image Optimization → Image Optimization Settings.
- Turn on Auto Request Cron and Auto Pull Cron so new uploads are processed automatically.
- Turn on Optimize Original Images and, if you trust the result, Remove Original Backups later.
- Turn on Create WebP Versions and Image WebP Replacement.
- Open the Image Optimization Summary tab and click Send Optimization Request to process existing images.
Other good plugins are ShortPixel, Imagify and EWWW Image Optimizer. Use only one optimisation plugin.
Lazy load and set dimensions
- WordPress adds
loading="lazy"to most images automatically. LiteSpeed Cache's Page Optimization → Media Settings → Lazy Load Images extends this to more cases. - Exclude the main image at the top of the page (the hero or featured image) from lazy loading, because delaying it hurts LCP. Add its class or file name under Lazy Load Image Excludes.
- Make sure images have width and height attributes so the layout does not jump while loading.
Remove unused image sizes
Each upload creates several thumbnail sizes, and themes and plugins often add more. Check Settings → Media and set sizes you do not use to 0. Themes may register extra sizes in code; a plugin such as Regenerate Thumbnails shows the list and can rebuild sizes after a theme change.
Clean up the media library
- Delete obviously unused uploads in Media → Library, but be careful: an image may be used in a page builder layout without being "attached" to a post.
- Do not delete files directly in
wp-content/uploadsvia File Manager; WordPress would still reference them.
Check the results
Run PageSpeed Insights again. In your browser's developer tools (F12 → Network → filter Img) the image type should show webp for supported browsers and sizes should be in the tens or low hundreds of kilobytes.
Troubleshooting
- WebP images not served: purge all caches after enabling replacement; CDN caches may also need a purge.
- Optimisation requests stay pending: the QUIC.cloud domain key is missing; request it in LiteSpeed Cache → General.
- Images look blurry: lower the compression level, or upload larger originals for retina displays.
