In WordPress, by default svg type of files are not permitted to upload.
So in order to upload the SVG files to WordPress media library, we will need to add following code to child theme’s functions.php file:
//To allow svg files uploading function allow_svg_upload_mimes($mimes = array()) { // Add a key and value for the SVG file type $mimes['svg'] = "text/svg"; return $mimes; } add_action('upload_mimes', 'allow_svg_upload_mimes');
Now, this code will allow the SVG file types to get uploaded to a media library.