After a CMS migration, the formats that actually speed up page load are AVIF and WebP for photographs and complex images, SVG for logos and icons, and well-compressed JPEG only as a fallback. The gains come from two things at once: replacing legacy PNG and JPEG payloads with modern codecs, and making sure the new CMS serves the right format to each browser instead of one heavy file to everyone. A migration is the rare moment when this is cheap to fix. Media libraries get rewritten, URLs change, and image handling is already being reconfigured — so swapping formats and regenerating derivatives costs far less effort than it would on a settled site.
Official resources:
- Run Lighthouse's "Serve images in modern formats" check on your site — Chrome's own documentation explains how Lighthouse estimates the bytes you would save by converting JPEG and PNG images to WebP or AVIF, so you can measure the gain on your migrated pages.
- Compare browser support and compression for each web image format on MDN — MDN's format guide lets you verify which formats current browsers support and which to use as a fallback before switching your media library over.
Table of Contents
- Why images get slower after a migration, not faster
- AVIF vs WebP vs JPEG vs PNG: what to use where
- Serving multiple formats without breaking anything
- WordPress and Drupal specifics
- What to check in the first week
- Frequently Asked Questions
Why images get slower after a migration, not faster
Most migrations move the original uploads and leave the derivatives behind. The old platform may have been serving resized, compressed, cache-warmed variants; the new one often serves the full-size original until something regenerates the thumbnails. A 4,000-pixel-wide PNG that used to be delivered as a 60 KB WebP thumbnail can suddenly arrive as a multi-megabyte file. Format conversion plugins are another common casualty.
If the previous site had a WebP or AVIF layer — a plugin, a CDN image service, or server-level conversion — that layer does not migrate with the content. The HTML may still reference the same filenames while the conversion that made them small is gone. The third problem is markup. Theme changes frequently drop `srcset` and `sizes` attributes, or the explicit `width` and `height` that prevent layout shift. The format can be modern and the delivery still wasteful, because a phone downloads the desktop-sized file.
AVIF vs WebP vs JPEG vs PNG: what to use where
Treat this as a decision about image content, not a single sitewide setting: AVIF has real trade-offs. Encoding is slower and more CPU-intensive than WebP, which matters on shared hosting and on sites that upload in bulk.
Very small images sometimes come out larger as AVIF than as WebP, because the container overhead outweighs the compression advantage. And AVIF's lossy mode can smooth fine detail in ways photographers notice — test it against your own imagery rather than assuming the smaller file is the better one.
- **Photographs and screenshots** — AVIF first, WebP as fallback. AVIF generally produces the smallest files at a given visual quality, particularly on large hero images and gradients, where JPEG shows banding.
- **Graphics with flat colour, text, or transparency** — WebP, which supports both lossless and lossy modes and alpha transparency. It replaces PNG here with substantially smaller files.
- **Logos, icons, simple illustrations, charts** — SVG, a vector format that scales to any size from one small file. Minify it and strip editor metadata; never use SVG for photographs.
- **Animation** — WebP or AVIF instead of animated GIF. GIF is limited to 256 colours and produces very large files for even short clips; for anything longer, an MP4 or WebM video is the better answer.
- **JPEG and PNG** — keep as the fallback tier for older clients and for anything a third party will consume directly.
Serving multiple formats without breaking anything
Modern format support is near-universal in current browsers, but you still want a fallback path. There are three standard mechanisms. The `<picture>` element lists sources in order of preference and the browser takes the first one it supports: an AVIF source, then WebP, then a plain `<img>` with JPEG as the final fallback. This is explicit and debuggable, and it works regardless of host configuration — but it means your templates, not your server, control delivery. Content negotiation does the same job invisibly.
The server reads the browser's `Accept` header and returns AVIF or WebP under the original `.jpg` URL. This keeps your HTML unchanged, which is attractive right after a migration, but it demands a correct `Vary: Accept` response header. Without it, a CDN or proxy can cache a WebP response and then serve it to a client that asked for JPEG — a cache-poisoning bug that is unpleasant to diagnose because it only appears for some visitors. A third option is to hand the problem to an image CDN or a service like Cloudflare Images, Cloudinary, or imgix, which handles format selection, resizing, and caching at the edge. It is the least work and the most reliable, at the cost of a recurring bill and a dependency.
WordPress and Drupal specifics
WordPress generates multiple sizes for every upload and has supported WebP output natively in recent versions; AVIF support depends on the version plus whether the server's Imagick or GD library was compiled with AVIF. Check what the host actually has before planning around it. The important post-migration step is regenerating thumbnails, so every registered size exists in the new format — a plugin or a WP-CLI media regeneration command does this. Also confirm that `wp_get_attachment_image` or the theme's own output is still emitting `srcset`; a hand-built template that hardcodes `<img src>` discards responsive delivery entirely. Drupal handles this through image styles and responsive image styles, with conversion done by a convert effect in the style pipeline.
Drupal's `responsive_image` module maps breakpoints to image styles and can emit a `<picture>` element with multiple format sources, which makes it the cleaner platform for an explicit AVIF-then-WebP cascade. Image styles are generated on first request, so the first visitor after a migration pays the derivative-generation cost — warm the important pages rather than letting a crawler or a real user discover that. On either platform, be careful with the old files. Converting in place and deleting the originals leaves you unable to re-encode later at different quality settings or to a format that does not exist yet. Keep the uploads; generate the derivatives.
What to check in the first week
Format is one input to loading performance, and after a migration it is rarely the only thing that changed. Work through the cheap checks first: Also audit the old URLs.
Migrations commonly change media paths, and an image returning 404 costs a request and a visible gap even though it weighs nothing. Modern formats do not help a file that is not there.
- Pull up a few key pages in the browser's network panel and sort by size. Anything over a few hundred kilobytes that is not a video deserves attention.
- Confirm the format being delivered, not the format you configured. The response's `Content-Type` tells you what actually arrived.
- Check that `Vary: Accept` is present if you are using content negotiation.
- Verify explicit `width` and `height` on images, which lets the browser reserve space and avoids cumulative layout shift.
- Mark below-the-fold images `loading="lazy"` and leave the largest above-the-fold image eager — lazy-loading your hero delays the Largest Contentful Paint you are trying to improve.
Frequently Asked Questions
Should I convert every existing image, or only new uploads?
Convert the images on pages that get traffic first, then backfill. A full-library conversion on a large site is a long, CPU-heavy job with most of its benefit concentrated in a small fraction of the files.
Does switching to AVIF or WebP affect Google Images rankings?
Google indexes both formats. What matters for image search is unchanged by the migration: descriptive filenames, accurate alt text, an image sitemap, and stable URLs.
Is it worth keeping JPEG fallbacks at all now?
Yes, as a cheap safety net. The fallback costs one extra line of markup and covers old browsers, email clients, and any third-party scraper that only understands legacy formats.




