Wednesday, May 27, 2020

svg file not upload in wordpress

Cannot upload SVG files in WordPress


When we upload the SVG file, we recieve the notification “Sorry, this file type is not permitted for security reasons.”

To Resolve this issue, we need to add the below function in the functions.php files

function cc_mime_types($mimes) {
 $mimes['svg'] = 'image/svg+xml';
 return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');

This will resolve the issue.