Monday, July 8, 2013

How to allow SVG files through Media Uploader of WordPress

SVG files are rejected when attempting to upload them through the media uploader of WordPress.

Add code below in your functions.php file of your active template to allow them:

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