Skip to content

[00] Subset Sizes, Guide

AVIF upload error "This image cannot be processed by the web server"

Why WordPress refuses AVIF uploads on some servers, how to check your image library in Site Health, and how to serve AVIF without uploading it.

Published
Fix uses
Subset Sizes Pro
Reading time
4 min

What the error means

WordPress has accepted AVIF uploads since version 6.5 (opens in a new tab). It hands the image work to your server’s image library, GD or Imagick, so AVIF works only when that library can handle the format.

Before an AVIF file uploads, WordPress asks whether any image editor on the server supports image/avif. If none does, the uploader removes the file from the queue and shows this message:

The web server cannot generate responsive image sizes for this image. Convert it to JPEG or PNG before uploading.

That’s the wording from WordPress 6.8 on. Versions 6.5 to 6.7 show “This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading.” Both come from the same check: wp_plupload_default_settings() (opens in a new tab) sets avif_upload_error when wp_image_editor_supports() (opens in a new tab) returns false for AVIF.

WordPress makes several smaller sizes of every image you upload. It can’t make them from a format its image library can’t edit, so it stops the upload before the file reaches the media library.

Check what your server supports

Go to Tools → Site Health, open the Info tab and expand Media Handling. Three rows tell you where you stand:

  • Active editor names the library WordPress tries first.
  • GD supported file formats lists the formats GD was built with.
  • ImageMagick supported file formats lists the formats Imagick reports.

If AVIF appears in neither list, your server can’t handle it. AVIF in the ImageMagick list isn’t proof that it can write AVIF files. Some ImageMagick builds list AVIF because they can decode it, with no encoder to create one.

If you have shell access, you can check GD directly. Look for AVIF Support in the output, which is the same value Site Health reads:

php -r 'print_r(gd_info());'

The PHP on the command line can differ from the one serving your site, so trust Site Health if the two disagree.

Ask your host for AVIF support

Adding AVIF support is a server change, so on managed or shared hosting it’s a request to your host. Ask for one of these:

  • PHP 8.1 or later, with GD built with AVIF support. GD gained AVIF in PHP 8.1, through the --with-avif build option described in the PHP image installation notes (opens in a new tab).
  • The Imagick extension, linked to an ImageMagick build that can write AVIF files, not only read them.

Once the change is made, reload Media Handling and check that AVIF is listed. Until then, do what the error message says: convert AVIF files to JPEG or PNG before you upload them.

Serve AVIF without uploading AVIF

Most sites don’t need to upload AVIF files. They need visitors to receive them. You can upload JPEG and PNG as you do now and send AVIF or WebP copies to the browsers that support them.

Subset Sizes Pro does this. Under Subset → Image Sizes → Formats, Make AVIF copies and Make WebP copies are both on by default. Pro writes each copy next to the file it was made from, so photo-300x200.jpg gets photo-300x200.jpg.avif and photo-300x200.jpg.webp. Your original upload is kept.

With the default Picture element (recommended) delivery, Pro wraps each image in a <picture> element. It lists the AVIF copy, then the WebP copy, then your original <img>. The browser uses the first format it supports, and every URL always returns the same file, so it works behind any CDN.

The free Subset Sizes makes sizes in the same format as the original upload. AVIF and WebP copies need Pro.

What Pro does when the server can’t write AVIF

Pro asks WordPress the same question the uploader does. If no image editor reports AVIF support, the Make AVIF copies box is disabled and marked “not supported by this server’s image library”. Pro then makes WebP copies only, as long as the server can write WebP.

If an editor claims AVIF but fails to save the file, Pro tries the next editor that claims the format, usually GD. When none of them can write it, no AVIF copy is made for that file. Nothing breaks on the page:

  • The <picture> element lists a format only when every file in the image’s srcset has a copy on disk.
  • Without a complete set of AVIF copies, the browser gets the WebP copy or your original.
  • A page never points at an AVIF file that doesn’t exist.

After your host adds AVIF support, new uploads get AVIF copies in the background. For images already in the library, count the missing copies first, then make them:

wp subset image-resizer formats backfill --format=avif --dry-run
wp subset image-resizer formats backfill --format=avif

If the server still can’t write AVIF, the command stops with “AVIF is off on the Formats tab, or this server’s image library can’t write it.” That makes it a fast way to confirm the host’s change took effect.

Format choice, quality settings and the server-side delivery option are covered in WebP, AVIF and JPEG.