Вернуться к Блогу
Платформы

AVIF WordPress 2026: Полное Руководство по Настройке [Плагин]

Настройте AVIF на WordPress: установка плагина, фрагменты кода, интеграция CDN. WordPress быстрее на 50% →

27 января 202511 мин чтения
AVIF WordPress 2026: Полное Руководство по Настройке [Плагин] - AVIF.expert

WordPress AVIF Support

WordPress added native AVIF upload support in version 6.1 (November 2022), but optimal implementation requires additional configuration.

Out of the box, WordPress 6.1+ allows AVIF file uploads through the media library. However, the CMS doesn't automatically convert existing images or generate AVIF thumbnails—you need plugins or custom code for that.

Server requirements also matter. Your hosting must have AVIF support in the image processing library (typically ImageMagick or GD). Many shared hosts now support this, but verification is recommended.

Plugin Options

Several excellent plugins handle AVIF conversion and delivery.

  • ShortPixel: Converts images to AVIF on upload or in bulk. Includes CDN option for automatic format delivery.
  • Imagify: From WP Rocket team. WebP and AVIF conversion with smart serving based on browser support.
  • EWWW Image Optimizer: Local conversion option (no external API). Supports AVIF with proper server configuration.
  • Converter for Media: Free option for AVIF/WebP conversion with .htaccess-based serving.

💡 Совет Профессионала

ShortPixel and Imagify offer the best balance of features and ease of use for most WordPress sites.

Server Configuration

Proper server configuration ensures AVIF files are served correctly.

This configuration checks if an AVIF version of each image exists and serves it to supporting browsers automatically. The original JPEG/PNG remains the fallback.

# Apache .htaccess for AVIF serving
<IfModule mod_rewrite.c>
  RewriteEngine On
  
  # Check if AVIF version exists and browser supports AVIF
  RewriteCond %{HTTP_ACCEPT} image/avif
  RewriteCond %{REQUEST_FILENAME} (.+)\.(jpe?g|png|gif)$
  RewriteCond %{REQUEST_FILENAME}.avif -f
  RewriteRule ^(.+)\.(jpe?g|png|gif)$ $1.$2.avif [T=image/avif,E=avif:1,L]
</IfModule>

# Nginx configuration
location ~* ^(.+)\.(jpe?g|png|gif)$ {
  set $avif_suffix "";
  if ($http_accept ~* "image/avif") {
    set $avif_suffix ".avif";
  }
  try_files $uri$avif_suffix $uri =404;
}

WooCommerce Integration

E-commerce sites benefit most from AVIF. Here's WooCommerce-specific implementation.

WooCommerce generates multiple image sizes for products: thumbnails, catalog images, and single product images. Ensure your optimization plugin converts all registered image sizes to AVIF.

Product galleries particularly benefit from AVIF. A typical gallery with 5-10 images can see 2-4MB savings, dramatically improving product page load times.

<?php
// Functions.php: Register AVIF support for WooCommerce images
add_filter('woocommerce_product_get_image', function($image, $product) {
    // Plugin-specific: Modify image HTML to include AVIF srcset
    return apply_filters('avif_product_image', $image, $product);
}, 10, 2);

Связанные Инструменты

Часто Задаваемые Вопросы

Does WordPress support AVIF uploads?
Yes, WordPress 6.1+ supports AVIF uploads natively. Older versions require plugins for upload support.
Which plugin is best for WordPress AVIF?
ShortPixel and Imagify are top choices. Both offer reliable AVIF conversion with reasonable pricing for most site sizes.
Will AVIF work with my caching plugin?
Yes, but configure your cache to vary by Accept header or use a plugin that handles format-specific caching automatically.

Готовы Конвертировать Изображения?

Попробуйте наш бесплатный конвертер AVIF - загрузка не требуется, 100% приватно.

Начать Конвертацию

Связанные Статьи