WP-CLI commands are available. If you have a large number of files, WP-CLI commands is more reliable.
* wp pluswebpavif
* wp pluswebpavif webp
-> Generated WebP.
* wp pluswebpavif avif
-> Generated AVIF.
* wp pluswebpavif webp --mail=true
-> Send results via email.
* wp pluswebpavif webp --pid=12152
-> Process only specified Media ID.
* wp pluswebpavif avif --quality=90
-> Specifies the quality of WebP or AVIF.
* wp pluswebpavif webp --replace=false
-> WebP or AVIF replacement of images and contents.
* wp pluswebpavif avif --addext=true
-> Append the webp or avif extension to the original filename.
* wp pluswebpavif webp --types=image/png,image/gif
-> MIME type to convert.
/** ==================================================
* Filter for advanced change database.
* If you want to replace other databases besides content.
*/
add_filter(
'plus_webp_advanced_change_db',
function( $before_url, $after_url ) {
/* Your processing */
return array( $before_url, $after_url );
},
10,
2
);