跳到内容

Images to AVIF

v2.0

kubiq · 2026年1月13日 上架

Convert PNG, JPG, GIF and WEBP images to AVIF and speed up your web loading

正在使用
100+
评分
暂无
累计下载
2,002
最近更新
2026年9月18日
需要 WordPress 5.0+已测试到 6.9.12PHP 7.0+

贡献者

截图

Images to AVIF
Images to AVIF
Images to AVIF

Statistics say that AVIF format can save more than a half of the page weight without losing images quality.
Convert PNG, JPG, GIF and WEBP images to AVIF and speed up your web, save visitors download data, make your Google ranking better.
Install also Images to WebP plugin if you want to have fallback to WebP and then to the original file.

  • automated test after plugin activation to make sure it will work on your server
  • works with all types of WordPress installations: domain, subdomain, subdirectory, multisite/network
  • works on Apache and NGiNX
  • image URL will be not changed so it works everywhere, in <img> src, srcset, <picture>, even in CSS backgrounds and there is no problem with cache
  • original files will be not touched
  • set quality of converted images
  • auto convert on upload
  • only convert image if AVIF filesize is lower than original image filesize
  • bulk convert existing images to AVIF ( you can choose folders )
  • bulk convert only missing images

Hooks for developers

images_to_avif_sizes

Maybe you want to disable AVIF for thumbnails

add_filter( 'images_to_avif_sizes', 'disable_images_to_avif_sizes', 10, 2 );
function disable_images_to_avif_sizes( $sizes, $attachmentId ){
    unset( $sizes['thumbnail'] );
    return $sizes;
}

images_to_avif_htaccess

Maybe you want to modify htaccess rules somehow

add_filter( 'images_to_avif_htaccess', 'modify_images_to_avif_htaccess', 10, 2 );
function modify_images_to_avif_htaccess( $rewrite_rules ){
    // do some magic here
    return $rewrite_rules;
}

images_to_avif_abspath

Maybe you use roots.io/bedrock or other custom folder structure

add_filter( 'images_to_avif_abspath', 'modify_images_to_avif_abspath', 10, 2 );
function modify_images_to_avif_abspath( $abspath ){
    return trailingslashit( WP_CONTENT_DIR );
}

$images_to_avif->convert_image()

Maybe you want to automatically generate AVIF for other plugins

add_action( 'XXPLUGIN_image_created', 'XX_images_to_avif', 10, 2 );
function XX_images_to_avif( $image_path ){
    global $images_to_avif;
    $images_to_avif->convert_image( $image_path );
}

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums