0

enter image description here I Added the Unfiltered uploads to wp-config still it does not upload webp. But it works for other file such as gif, rar.zip

dipmala
  • 2,003
  • 1
  • 16
  • 17
Anandkumar
  • 43
  • 3
  • 8

2 Answers2

0

Try this function

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 type
return $existing_mimes;
}
add_filter( 'mime_types', 'webp_upload_mimes' );
Harsh Khare
  • 507
  • 1
  • 3
  • 13
0

You need to add mime types in upload which you can achieve using following function.

        add_filter( 'mime_types', 'webp_upload_mimes' ); 
        function webp_file_upload( $mimes ) 
        {
            $mimes['webp'] = 'image/webp'; // add webp in mime type
            return $mimes; // return the mime types
        }

Hope this will work for you

dipmala
  • 2,003
  • 1
  • 16
  • 17