Víctor GeisAllow SVG File Uploads In WordPress

Allow SVG File Uploads In WordPress

Copy and paste this function into your functions.php file of your WordPress theme:

function vg_upload_svg_files( $allowed ) {
    if ( !current_user_can( 'manage_options' ) )
        return $allowed;
    $allowed['svg'] = 'image/svg+xml';
    return $allowed;
}
add_filter( 'upload_mimes', 'vg_upload_svg_files');