Upload SVG Files To WordPress

Allowing SVG Files in WordPress so you can upload them through the Media panel is surprisingly simple. This allows you to harness the power and speed benifits of SVG Files as opposed to Raster Images.

Either add the following snippet to your theme's functions.php file or create a WordPress plugin that executes the following code:

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

There are security concerns to allowing SVG files to be uploaded, so make sure that only trusted contributors have access to uploading.

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up With Harner Designs!

Get updates about New Projects, Products, Discounts, and Giveaways from Harner Designs!

By submitting your email, you agree to our Privacy Policy and give us consent to send you marketing and promotional emails. You can unsubscribe at any time.