Best SEO and PPC Tool - Extended Free Trial  GO!
wordpress snippets

Upload SVG to WordPress

Last modified: January 13, 2020

Cloudways

Add the above function to your functions.php file and you will be able to add SVG files to the WordPress media.

function add_svg_to_upload_mimes( $upload_mimes ) {
  $upload_mimes['svg'] = 'image/svg+xml';
  $upload_mimes['svgz'] = 'image/svg+xml';
  return $upload_mimes;
}
add_filter( 'upload_mimes', 'add_svg_to_upload_mimes', 10, 1 );

 

Show More

* This button will show the rest of the post and open up an offer from a vendor
Save 4 Later
Email liked links to yourself