0

I addes this code to allow SVG Uploads to the Media Library of wordpress:

function upload_svg ( $svg_mime ){
$svg_mime['svg'] = 'image/svg+xml';
return $svg_mime;
}

add_filter( 'upload_mimes', 'upload_svg' );
define('ALLOW_UNFILTERED_UPLOADS', true);

Than I added some SVGs to the Media Library. Using them works perfectly fine. The only Issue I have is that they will not be displayed in the Media Library. On other Pages in the Backend they display fine.

Is there anything I can do to display them in the Media Tab aswell? I couln't find anything online on how to fix this issue.

1
0

This is the solution to allow SVG upload and preview to Media area of WordPress: https://gist.github.com/benfrain/9422862

0
+50

Try to use this plugin: https://wordpress.org/plugins/wp-extra-file-types/. I use it and .svg files seems fine in media lib.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.