WordPress doesn’t natively support uploading or displaying WebP images

WebP is a newer file format for images to be used on the web. By using the WebP image format, your images will be 25-34% smaller in file size than PNG and JPEG without losing quality.

Some plugins are free but they demand active API to convert all images indide a media folder.

As they perform active API and rewrite Apache rule it is an issue how to do this inside cPanel as it supports NGINX where htaccess rewrite rule does not have an effect.

Can be managed without a plugin in the case of NGINX and cPanel?

With NGINX you can do your rewrites in the http.conf file instead of the htaccess file used by Apache.

Can be managed to convert existing assets folder into WebP format?

function WebP_upload_mimes( $existing_mimes ) {
// add WebP to the list of mime types$existing_mimes[‘WebP’] = ‘image/WebP’;
// return the array back to the function with our added mime typereturn $existing_mimes;}add_filter( ‘mime_types’, ‘WebP_upload_mimes’ );

//** * Enable preview / thumbnail for WebP image files.*/function WebP_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WebP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result;}add_filter(‘file_is_displayable_image’, ‘WebP_is_displayable’, 10, 2);
}

How to include inside above function just a specific folder like assets folder:
content/themes/assets
Source: https://fluentsmtp.com/how-to-upload-webp-images-in-wordpress/