How to Use AVIF Images in WordPress (Without Breaking Your Media Library)

WordPress 6.5 added AVIF uploads — but only if the server underneath can actually decode them. Here is how to check in two minutes, and what to do when it cannot.

Last updated: 2026-11-01 · Reviewed by Yilin Xu

The short answer

Since WordPress 6.5, the media library accepts .avif uploads and can generate the usual thumbnail sizes — if the server's image library (Imagick) was compiled with AVIF support. Many shared hosts were not, and some still are not. When support is missing, uploads either fail outright or succeed without generating thumbnails, which is worse because the breakage is silent.

So the order is always the same: check the server first, test with one file second, upload a folder third. Never upload a client's 200-image delivery before you have confirmed that one AVIF survives the round trip.

What WordPress actually supports

It is worth separating two questions that get mixed up: can WordPress accept the file and can the server generate resized versions of it. The first is a whitelist in PHP; the second depends on a compiled library. A site can pass the first and fail the second.

Check your server in two minutes

  1. In the WordPress admin, go to Tools → Site Health.
  2. Open the Info tab, then expand Media Handling.
  3. Look for ImageMagick supported formats — a long comma-separated list.
  4. Search that line for AVIF.

If AVIF appears in the list, your server can decode it and WordPress will generate thumbnails normally. If it does not appear, or if the Media Handling section only shows a version number without a format list, your host's Imagick was built without libheif or without an AV1 decoder. See the ImageMagick guide for what that error looks like on the command line — it is the same underlying problem.

On managed hosts that hide Site Health, the equivalent question to support is: "Is Imagick compiled with AVIF support, and which libheif version?" Asking in those terms gets a faster answer than "do you support AVIF?".

If AVIF is missing from the list

You have three options, in order of effort:

What you should not do is upload AVIF files to a server that cannot process them and hope. The media library will show the original, but every thumbnail size will be missing or broken, and page builders that rely on a specific size will fall back to the full image — quietly making your pages slower.

A safe test procedure

  1. Upload one AVIF through Media → Add New.
  2. Open it in the media library and check that the details panel lists dimensions and file size.
  3. Look at the thumbnail grid — is there an actual image, or a grey placeholder?
  4. Insert it into a draft post and view the page on the front end.
  5. Check that a srcset with multiple sizes is being output, not a single full-size file.

If steps 2–5 all pass, batch upload is safe. If the thumbnail is a grey placeholder, stop — the server accepted the file but could not decode it, and every image you add will behave the same way.

Common failures and what they mean

SymptomCauseFix
"Sorry, you are not allowed to upload this file type."WordPress older than 6.5, or a security plugin restricting MIME typesUpdate WordPress; check the plugin's upload whitelist
Upload succeeds, thumbnails are blankImagick cannot decode AVIFEnable AVIF on the server, or upload JPG
"The server cannot process the image."Same cause, surfaced as an error by the image editorSame fix
Image displays, but pages got slowerMissing intermediate sizes, so the full-size file is servedRegenerate thumbnails after enabling AVIF support
AVIF works in the library but not on the live siteA CDN or optimisation plugin is rewriting or stripping the filePurge the CDN cache; check the plugin's format settings

The workflow most sites should use

Upload a high-quality JPG or PNG master, and let an optimisation plugin generate AVIF or WebP for delivery. This keeps the media library portable — you can migrate hosts, change plugins, or hand the site to a client without a pile of files that half the tooling cannot read — while still serving small images to visitors.

Upload AVIF directly only when it is the only source you have: a client sent AVIF product shots, or you exported them from a tool that writes nothing else. In that case, convert to JPG first unless you have confirmed server support, because a media library full of undecodable files is expensive to clean up later.

Cleaning up an existing library

If you already uploaded AVIF files to a server that cannot process them, the fix is not to delete and re-upload blindly — you will lose the attachment IDs that posts reference. Instead: enable AVIF support on the server if you can, then regenerate thumbnails with a plugin such as Regenerate Thumbnails. If the server will never support AVIF, replace the files in place (same filename) with JPG versions and regenerate.

Back up the uploads directory before either operation. Regenerating thumbnails on a large library is I/O-heavy and can time out on cheap hosting; run it in batches.

Frequently asked questions

Does WordPress support AVIF without a plugin?Since 6.5, yes — if the server's Imagick can decode it. The plugin question is separate: plugins are what generate AVIF variants when the server cannot.
Is AVIF better than WebP for WordPress?Usually smaller for photos, but support is narrower and the server requirements are stricter. WebP is the safer default; AVIF is the better payoff when your stack supports it.
Why did my AVIF upload produce no thumbnail sizes?The server decoded nothing, so WordPress had no pixels to resize. Confirm with Site Health → Info → Media Handling and look for AVIF in the supported formats list.
Will WordPress convert my AVIF to JPG automatically?No. It stores what you upload and generates sizes in the same format. If you need JPG, convert before uploading.
Does the block editor accept AVIF in image blocks?Yes, once the file is in the media library. The block editor does not decode images itself — it relies on the sizes WordPress generated.

Related guides