Title: WordPress 6.5 adds AVIF support 
Author: Adam Silverstein
Published: February 23, 2024
Last modified: June 5, 2025

---

 [  ](https://profiles.wordpress.org/adamsilverstein/) [Adam Silverstein](https://profiles.wordpress.org/adamsilverstein/)
6:54 pm _on_ February 23, 2024     
Tags: [6-5 ( 76 )](https://make.wordpress.org/core/tag/6-5/),
[core-images ( 9 )](https://make.wordpress.org/core/tag/core-images/), [dev-notes ( 648 )](https://make.wordpress.org/core/tag/dev-notes/),
[dev-notes-6.5 ( 15 )](https://make.wordpress.org/core/tag/dev-notes-6-5/), [images ( 10 )](https://make.wordpress.org/core/tag/images/)

# WordPress 6.5 adds AVIF support 

WordPress 6.5 supports AVIF, a modern image format that offers significant improvements
in image quality and compression over previous formats like JPEG, PNG, and even 
WebP.  AVIF images can be up to 50% smaller than JPEGs while maintaining the same
image quality. AVIF images also support a wide range of colors (including HDR) and
produce sharper images than JPEGs, especially in areas with high detail.

From WordPress version 6.5 forward, you can upload and use AVIF images in WordPress
just like you would a JPEG or PNG image today – as long as your hosting environment
supports AVIF. Switching to the AVIF format for your images is likely to improve
your site’s performance and your site visitor’s experience. 

## How AVIF helps you

AVIF images are significantly smaller than their JPEG equivalents, so pages load
more quickly and take less bandwidth to transmit. AVIF images still get all of the
benefits of the responsive images, Fetch Priority, and lazy loading that WordPress
supports by default. Finally, AVIFs are [supported](https://caniuse.com/avif) in
all major browsers, so most sites can start using them today.

## Creating AVIF images

Many image editing tools support exporting to AVIF. You can also use command line
conversion tools or web based open sourceOpen Source Open Source denotes software
for which the original source code is made freely available and may be redistributed
and modified. Open Source **must be** delivered via a licensing model, see GPL. 
tools like [Squoosh](https://squoosh.app/). Once you save your images as AVIF, upload
them to WordPress and use them like you would any other image. WordPress can also
create AVIFs for you automatically, for more details, see the FAQ item below.

## Using AVIF images in WordPress

AVIF images work like any other image format in WordPress, with a few important 
notes:

AVIF in WordPress depends on support in your web server’s image processing library(
WordPress has built-in support for both _Imagick_ and _LibGD _for image processing).
You can check for AVIF support in wp-adminadmin (and super admin) by visiting Tools-
> Site Health, clicking the “Info” tab and expanding the “Media Handling” section,
then finally looking for “AVIF” in the list of supported formats.

If your audience includes a significant number of users on an unsupported browser,
either avoid using AVIF images, or enqueue a browser [polyfill](https://github.com/Kagami/avif.js).

## FAQ

**Q: How do I adjust the compression level used for generated AVIF images?**

The `wp_editor_set_quality` filterFilter Filters are one of the two types of Hooks
[https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
They provide a way for functions to modify data of other functions. They are the
counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
manner, and should never have side effects such as affecting global variables and
output. can be used to set the quality setting. The passed mime type enables setting
by type, for example:

    ```wp-block-code
    // Use a quality setting of 75 for AVIF images.function filter_avif_quality( $quality, $mime_type ) {	if ( 'image/avif' === $mime_type ) {		return 75;	}	return $quality;}add_filter( 'wp_editor_set_quality', 'filter_avif_quality', 10, 2 );
    ```

**How can I output lossless AVIF images?**

Using a compression level of 100 will set AVIF to its lossless mode.

**Q: Can WordPress create AVIF images when I upload JPEGs?**

Yes. Developers can use the `image_editor_output_format` filter to specify this 
type of transformation for uploads. Here is an example:

    ```wp-block-code
    // Output AVIFs for uploaded JPEGsfunction filter_image_editor_output_format( $formats ) {	$formats['image/jpeg'] = 'image/avif';	return $formats;}add_filter( 'image_editor_output_format', 'filter_image_editor_output_format' );
    ```

**Q: Can WordPress create AVIF images when I upload HEIC images?**

Yes. Developers can use the `image_editor_output_format` filter to specify this 
type of transformation for uploads. Here is an example:

    ```wp-block-code
    // Output AVIFs for uploaded HEICs
    function filter_image_editor_output_format( $formats ) {
    	$formats['image/heic'] = 'image/avif';
    	return $formats;
    }
    add_filter( 'image_editor_output_format', 'filter_image_editor_output_format' );
    ```

**Q: If I use WordPress multisitemultisite Used to describe a WordPress installation
with a network of multiple blogs, grouped by sites. This installation type has shared
users tables, and creates separate database tables for each blog (wp_posts becomes
wp_0_posts). See also network, blog, site, will all my sites work with AVIF images?**

No. Multisite stores the file types that users are allowed to upload when a site
is created. We are still working on improving this in [#53167](https://core.trac.wordpress.org/ticket/53167).
In the meantime, to ensure all existing sites on a networknetwork (versus site, 
blog) allow AVIF files, you can use the `site_option` filter in a network mu-pluginPlugin
A plugin is a piece of software containing a group of functions that can be added
to a WordPress website. They can extend functionality or add new features to your
WordPress websites. WordPress plugins are written in the PHP programming language
and integrate seamlessly with WordPress. These can be free in the WordPress.org 
Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
or can be cost-based plugin from a third-party. to add avif to the allowed file 
types for all network sites:

    ```wp-block-code
    // Ensure all network sites include AVIF support.function filter_site_option_upload_filetypes( $filetypes ) {	$filetypes = explode( ' ', $filetypes );	if ( ! in_array( 'avif', $filetypes, true ) ) {		$filetypes[] = 'avif';	}	return implode( ' ', $filetypes );}add_filter( 'site_option_upload_filetypes', 'filter_site_option_upload_filetypes' );
    ```

---

Thanks to [@stevenlinx](https://profiles.wordpress.org/stevenlinx/) and [@westonruter](https://profiles.wordpress.org/westonruter/)
for reviewing this post.

[#6-5](https://make.wordpress.org/core/tag/6-5/), [#core-images](https://make.wordpress.org/core/tag/core-images/),
[#dev-notes](https://make.wordpress.org/core/tag/dev-notes/), [#dev-notes-6-5](https://make.wordpress.org/core/tag/dev-notes-6-5/),
[#images](https://make.wordpress.org/core/tag/images/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2024/02/23/wordpress-6-5-adds-avif-support/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2024/02/23/wordpress-6-5-adds-avif-support/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2024/02/23/wordpress-6-5-adds-avif-support/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2024/02/23/wordpress-6-5-adds-avif-support/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2024/02/23/wordpress-6-5-adds-avif-support/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2024/02/23/wordpress-6-5-adds-avif-support/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/8bdee1ff4aca162db4c7d3755c67c4a18da76f40e349b691b786ee6f48532b40?
     s=32&d=mm&r=g)
 2.   [nicohood](https://profiles.wordpress.org/nicohood/)  8:31 am _on_ February 24,
     2024
 3.  So right now there are some plugins that do that job for us. How would it work
     with wordpress? I remember that some plugins create a jpg and a webp or avif file
     and depending on the client support it will send out an avif or jpg. All Image
     URLs still link to .jpg but will be replaced on demand. Is that also true for 
     wordpress 6.5?
 4.  So we also need to enable this feature somewhere?
 5.  Is there a way to convert existing files (and still keep the .jpg urls intact)?
 6.  And what is the recommandation here, i mean around 90% browsers support avif, 
     so should we just do a 100% switch in order to save a lot of webspace (like us,
     we host a lot of images on our site)?
 7.   * ![](https://secure.gravatar.com/avatar/82e095c8bc229017b128e53940ea534aa31f6624431bedee24c7e8756e42dd1c?
        s=32&d=mm&r=g)
      *  [Adam Silverstein](https://profiles.wordpress.org/adamsilverstein/)  3:41 
        pm _on_ February 25, 2024
      * Responses inline below [@nicohood](https://profiles.wordpress.org/nicohood/)–
      * > So right now there are some plugins that do that job for us. How would it
        > work with wordpress? I remember that some plugins create a jpg and a webp
        > or avif file and depending on the client support it will send out an avif
        > or jpg. All Image URLs still link to .jpg but will be replaced on demand.
        > Is that also true for wordpress 6.5?
      * This change adds support for AVIFs in coreCore Core is the set of software 
        required to run WordPress. The Core Development Team builds WordPress. letting
        you use them like a JPEG – it doesn’t offer the advanced features you describe
        where the browser is served an image based on its capabilitiescapability A **
        capability** is permission to perform one or more types of task. Checking if
        a user has a capability is performed by the `current_user_can` function. Each
        user of a WordPress site might have some permissions but not others, depending
        on their role. For example, users who have the Author role usually have permission
        to edit their own posts (the “edit_posts” capability), but not permission to
        edit other users’ posts (the “edit_others_posts” capability)..
      * > So we also need to enable this feature somewhere?
      * In 6.5 you can use AVIFs “out of the box”, support is enabled by default.
      * > Is there a way to convert existing files (and still keep the .jpg urls intact)?
      * Not directly in core, plugins should let you do this.
      * > And what is the recommandation here, i mean around 90% browsers support avif,
        > so should we just do a 100% switch in order to save a lot of webspace (like
        > us, we host a lot of images on our site)
      * It depends to a degree on your visitors. Consider switching entirely to AVIF
        if you have data showing a low percentage of visitors with non-supporting browsers.
        If you don’t have that type of data, consider collecting it.
      * Otherwise, the best solution is probably using pluginPlugin A plugin is a piece
        of software containing a group of functions that can be added to a WordPress
        website. They can extend functionality or add new features to your WordPress
        websites. WordPress plugins are written in the PHP programming language and
        integrate seamlessly with WordPress. These can be free in the WordPress.org
        Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. to serve images with an image
        CDN which can provide both client negotiation and edge serving. Also good would
        be serving images using the “ element to serve AVIF’s with a JPEG fallback 
        for non supporting browsers. We don’t yet directly support this in core yet–
        this ticketticket Created for both bug reports and feature development on the
        bug tracker. covers adding it – [https://core.trac.wordpress.org/ticket/42920](https://core.trac.wordpress.org/ticket/42920).
         - ![](https://secure.gravatar.com/avatar/8bdee1ff4aca162db4c7d3755c67c4a18da76f40e349b691b786ee6f48532b40?
           s=32&d=mm&r=g)
         -  [nicohood](https://profiles.wordpress.org/nicohood/)  7:12 pm _on_ February
           25, 2024
         - Thanks for clarifying!
            And the filterFilter Filters are one of the two 
           types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
           They provide a way for functions to modify data of other functions. They
           are the counterpart to Actions. Unlike Actions, filters are meant to work
           in an isolated manner, and should never have side effects such as affecting
           global variables and output. `image_editor_output_format`, will this also
           rename the filename? To my understanding this will convert every jpg to 
           avif, so no jpg is ever saved on the server, only avif, right? This will
           result in lots of space saving. And will it be lossless or not?
            * ![](https://secure.gravatar.com/avatar/82e095c8bc229017b128e53940ea534aa31f6624431bedee24c7e8756e42dd1c?
              s=32&d=mm&r=g)
            *  [Adam Silverstein](https://profiles.wordpress.org/adamsilverstein/)  
              2:42 pm _on_ February 26, 2024
            * Right, with that filterFilter Filters are one of the two types of Hooks
              [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
              They provide a way for functions to modify data of other functions. They
              are the counterpart to Actions. Unlike Actions, filters are meant to 
              work in an isolated manner, and should never have side effects such as
              affecting global variables and output. output files will be AVIF instead
              of JPEG. AVIFs will be lossy (quality 82) by default, use quality 100
              to get lossless.
            * ![](https://secure.gravatar.com/avatar/24b68e30c5aca1c18ea836405ba1d723ab26ee96ef0ebf83a0c2d212d8cd58d9?
              s=32&d=mm&r=g)
            *  [ironprogrammer](https://profiles.wordpress.org/ironprogrammer/)  6:
              57 pm _on_ February 29, 2024
            * In response to [@nicohood](https://profiles.wordpress.org/nicohood/):
            * > …no jpg is ever saved on the server…
            * WordPress will always preserve the originally-uploaded file to support
              future edits or regeneration of subsizes.
            * In order to avoid saving, e.g. a 4 MB JPEG on the server 🙈, it could
              be converted to AVIF first, which is now supported as a “native” uploadable
              image format.
 8.  ![](https://secure.gravatar.com/avatar/6845456dbc9056f20a4cd50a6b95db78f2ae31df5c0601c613ee5b8939c41a82?
     s=32&d=mm&r=g)
 9.   [Jon Brown](https://profiles.wordpress.org/jb510/)  4:08 pm _on_ February 24,
     2024
 10. Delighted to see the land in coreCore Core is the set of software required to 
     run WordPress. The Core Development Team builds WordPress.. Well done folks.
 11. ![](https://secure.gravatar.com/avatar/2b8439faf05e34a2019a97889fd6ef5cb76c31f07487bcb44d815bdc9f1f8122?
     s=32&d=mm&r=g)
 12.  [Andrei Lupu](https://profiles.wordpress.org/euthelup/)  6:28 pm _on_ February
     25, 2024
 13. I’m so happy to see this!
      I’ve done some tests with RC2 and think this feature
     will push a lot of hosts to update their GD library so their users can crop AVIF
     files.
 14. Thanks for the great work!
 15. ![](https://secure.gravatar.com/avatar/2069b60f253f46dd6c8e8ef67c4077fa82d6c45ee1ed4c204ddf823d3deaeaa7?
     s=32&d=mm&r=g)
 16.  [Nicolas Grimm](https://profiles.wordpress.org/nicolasgrimm/)  10:16 am _on_ 
     March 16, 2024
 17. Well done!
 18. ![](https://secure.gravatar.com/avatar/050a3068cfbdd322f50361a572eadd95f5ac95ccfeedbe447bc5bc4d70e68973?
     s=32&d=mm&r=g)
 19.  [Phil](https://profiles.wordpress.org/probablynotphil/)  10:13 am _on_ March 
     19, 2024
 20. This is cool! However, I did a test with several photos and found that the quality
     for AVIF was substantially worse. For example colors were much more muted. Even
     when setting quality to 100. Is that normal?
 21.  * ![](https://secure.gravatar.com/avatar/050a3068cfbdd322f50361a572eadd95f5ac95ccfeedbe447bc5bc4d70e68973?
        s=32&d=mm&r=g)
      *  [Phil](https://profiles.wordpress.org/probablynotphil/)  10:14 am _on_ March
        19, 2024
      * Just noting that imagick is enabled on the server
         - ![](https://secure.gravatar.com/avatar/ff9015675ca7d3d9652c3aaa0a88cafa20de608fde1c39e70ab69b36c881aba0?
           s=32&d=mm&r=g)
         -  [juhosa](https://profiles.wordpress.org/juhosa/)  2:51 pm _on_ April 2,
           2024
         - I had similar problems with the offline ImageMagick software. Colors became
           washed out and the quality was sub-par, unless I cranked up the quality 
           paramater way high, but that resulted in too large file sizes.
         - I’m suspecting there might be something wrong with the ImageMagick AVIF 
           implementation.
      * ![](https://secure.gravatar.com/avatar/129025db831be5e21da859f4711fd2add835b1eb7603b96c6b88fd93e530068a?
        s=32&d=mm&r=g)
      *  [gregbenz](https://profiles.wordpress.org/gregbenz/)  11:03 pm _on_ April 
        2, 2024
      * [@Phil](https://profiles.wordpress.org/phil/) I’m seeing the same, wide gamut
        images are simply tagged as sRGB and therefore show as desaturated. Logged 
        as [https://core.trac.wordpress.org/ticket/60889](https://core.trac.wordpress.org/ticket/60889)
         - ![](https://secure.gravatar.com/avatar/050a3068cfbdd322f50361a572eadd95f5ac95ccfeedbe447bc5bc4d70e68973?
           s=32&d=mm&r=g)
         -  [Phil](https://profiles.wordpress.org/probablynotphil/)  3:14 pm _on_ April
           3, 2024
         - Interesting!
 22. ![](https://secure.gravatar.com/avatar/129025db831be5e21da859f4711fd2add835b1eb7603b96c6b88fd93e530068a?
     s=32&d=mm&r=g)
 23.  [gregbenz](https://profiles.wordpress.org/gregbenz/)  11:02 pm _on_ April 2, 
     2024
 24. A huge thanks to [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein/)
     and the coreCore Core is the set of software required to run WordPress. The Core
     Development Team builds WordPress. team for adding AVIF support!
 25. ![](https://secure.gravatar.com/avatar/782643f8fdd123de983f163562e230552a04525d025ce2113bfc373fb8bf931d?
     s=32&d=mm&r=g)
 26.  [Davide Prevosto](https://profiles.wordpress.org/daweb/)  8:27 am _on_ April 
     17, 2024
 27. Thank you all the team for this great feature.
      I noticed the original picture
     is not converted to AVIF, but it is preserved. Only “sizes” are converted and 
     they’re working well. Is this the correct behavior or am I doing it wrong?
 28. ![](https://secure.gravatar.com/avatar/77027b8817d13d8d4ed034d053a2f05dfd05aeb052e43bf560562931f73a6704?
     s=32&d=mm&r=g)
 29.  [joomskys](https://profiles.wordpress.org/joomskys/)  8:32 am _on_ May 8, 2024
 30. [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein/)
      Thank you
     all the team for this great feature. i have issue when i try to use AVIF image,
     can you help? the issue is:
 31.  * i have AVIF image file,
      * i uploaded it to wordpress via Media Upload -> [https://prnt.sc/54s8JQoSWgfl](https://prnt.sc/54s8JQoSWgfl)
      * image upload completed -> [https://prnt.sc/QZmqQiCD-R63](https://prnt.sc/QZmqQiCD-R63)
 32. BUT the image thumbnail size like : thumbnail, medium, large, … NOT CREATED ! -
     > [https://prnt.sc/A54F2cFUsHBH](https://prnt.sc/A54F2cFUsHBH)
      can you look and
     help ? am using siteground web hosting! Thanks

Comments are closed.

# Post navigation

[← Recap Hallway Hangout: What’s next for the outreach program?](https://make.wordpress.org/core/2024/02/23/recap-hallway-hangout-whats-next-for-the-outreach-program/)

[A Week in Core – February 26, 2024 →](https://make.wordpress.org/core/2024/02/27/a-week-in-core-february-27-2024/)