plugin-icon

Nik Images Auto Convert

Автор: Dmytro Nikolaienko·
Convert uploads to WebP or AVIF with adjustable quality, and convert your existing media library without breaking published pages.
Версия
1.0.1
Последние изменения
Jul 27, 2026

Nik Images Auto Convert does two things.

New uploads are converted the moment they arrive, before WordPress generates the thumbnails, so every registered size is created directly in the new format. Nothing is converted twice.

Images already on the site are converted in bulk. This is the part most plugins get wrong: renaming photo.jpg to photo.webp breaks every page that referenced the old name. This plugin rewrites those references — in post content, custom fields, widgets, theme options and page builder data — so published pages keep displaying the same images.

What it converts

  • JPEG, PNG and GIF, to WebP, AVIF, or the same format (compress only)
  • The full size image, every thumbnail size, and the untouched original WordPress keeps for large uploads
  • Animated GIFs are always skipped — converting them would keep only the first frame

How existing content is kept working

  • Every URL variant is handled: absolute, protocol relative, root relative, percent encoded, and the escaped-slash form page builders store in JSON
  • Serialized data is unserialized, rewritten and re-serialized so string lengths stay valid. Values that cannot be rebuilt with certainty are left untouched rather than risking corruption
  • Original files are copied to wp-content/uploads/nik-iac-originals/, so any conversion can be undone
  • An optional .htaccess rule — written inside the uploads folder, never in the site root — serves the converted file when something still requests the old URL; useful for hard coded theme paths, external links and search engine caches

Uploading WebP and AVIF files

WordPress permits both formats out of the box, but sites lose them again to security plugins, host level mime whitelists or themes that overwrite the upload_mimes filter wholesale. The plugin puts them back.

It also rescues uploads that are refused with «Sorry, this file type is not permitted for security reasons» — which happens when the server’s fileinfo library is too old to recognise the format and reports it as a plain binary. The extension is never trusted on its own: such a file is accepted only when its own header proves it really is WebP or AVIF, so renaming a script to .webp still gets it rejected.

Safety

  • Conversions that would produce a bigger file are skipped and the original is kept
  • EXIF orientation is baked into the pixels, so photos from phones do not end up sideways
  • Colour profiles survive metadata stripping
  • Nothing is deleted until the converted file has been written and verified
  • A built in test button converts five real images in a temporary folder and reports the actual saving, changing nothing

Requirements

The server needs either the Imagick extension or GD with WebP support. AVIF needs Imagick built with an AVIF delegate, or PHP 8.1+ for GD. The settings screen tells you exactly what your server can do.

WP-CLI

wp nik-images run [--force] [--dry-run] [--limit=<n>] wp nik-images restore wp nik-images status

Privacy

The plugin sends nothing anywhere. All conversion happens on your own server, and no external service is contacted.

Проверено на
WordPress 7.0.2
Этот плагин можно скачать и использовать при .