WordPress will not allow uploading SVG files even if the necessary mime types are added like this:
add_filter( 'upload_mimes', 'nvm_config_add_svg_to_upload_mimes' );
function nvm_config_add_svg_to_upload_mimes( $upload_mimes ) {
$upload_mimes['svg'] = 'image/svg+xml';
$upload_mimes['svgz'] = 'image/svg+xml';
return $upload_mimes;
}
if the SVG file does not have the special XML tag in its beginning like this:
<?xml version="1.0" encoding="UTF-8" ?>