Uploading SVG images in WordPress is not straight forward, you will need a plugin to enable SVG upload but often times all those plugins may not work. Here is a simple and straight forward piece of code you can add into your functions.php file within your theme. I advise you do this in your child theme to avoid future updates of the parent theme overwriting the code.

Copy the code below and paste in your functions.php file and save. Go try to upload your SVG file. Works like magic

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

Share this post