[Limited Time Offer] Get 40% off MEMBERSHIP PLUS before it's gone! 👉Get This Deal
Mark Hendriksen Logo

How to add an SVG logo to your Divi theme

Mark Hendriksen | April 2, 2019 | 6 Comments
Disclosure Note: Sometimes, I include links in my articles that can earn me money. It won't cost you anything, but it helps me pay for coffee ☕ so I can make more helpful content.

SVG images are great to use for your logo because of their scalability. However, by default you can’t upload SVG images to your Divi website. In this tutorial, I’ll show you 2 methods on how you can do this.

SVG Support plugin

The first method is with the SVG Support plugin by Benbodhi. After installing and activating this plugin you are able to upload SVG images. If you go to Settings > SVG Support than you find under settings some additional options.

If you check “Restrict to Administrators” than this will allow that only administrators can upload SVG images.

SVG support plugin settings

When you check the option “Enable Advanced Mode” you will get more advanced options for this plugin.

Manual method for uploading SVG logo to your Divi theme

In case you don’t want to use an extra plugin then you can also do this by adding some PHP code to your functions.php file. I strongly recommend doing this in your child theme functions.php file, if you are not doing this than your changes will be lost after a WordPress update. You can learn here how to create a child theme for Divi.

Place the following code in your child theme functions.php file:

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

You have now 2 methods on how you can upload an SVG logo to your Divi theme.

You Might Also Like…

Article by

Mark Hendriksen

I am the founder here at MarkHendriksen.com a blog website for Web design, WordPress, and Divi. Learn more about Mark

6 thoughts on “How to add an SVG logo to your Divi theme”

  1. Can I remove the code from functions file after uploading? Would this close the vulnerability that developers often discuss about svg?

    Reply
    • Hi,

      You should be able to remove that code afterward, although I am not 100% sure if the SVG will still work then, but I think it will.

      Reply
  2. I still can’t add svg to the library with the code (I can’t use the pluggin since it makes my divi pages insecure and I can’t edit them)

    Reply

Leave a Comment

94 Shares
Share94
Pin
Tweet