[wd_asp elements=’search’ ratio=’100%’ id=1]

How to upload Webp images to WordPress

13th March 2020

Wordpress - Miscellaneous

wordpress category

webp error uploading

If you receive the error ‘Sorry, This File Type Is Not Permitted For Security Reasons’ when uploading a .webp file then this code will solve the problem.

Add the following code to your functions.php file in your themes folder.


function my_custom_mime_types( $mimes ) {
$mimes['webp'] = 'image/webp';
return $mimes;
}
add_filter( 'upload_mimes', 'my_custom_mime_types' );