Hey guys and welcome back to DiviPeople. The passionate hub of Divi Lovers.

And in this tutorial, I am going to show you how to enable SVG uploads in Div theme Using Divi – AiO Plugin and you don’t have to code for this and it’s super easy.

So, first of all, go to Plugin > Add new and in the Search box Search for Divi AiO and then you have to install and activate this plugin.

Now you will have a New tab as Divi AiO in your Dashboard Menu.

Simply open Divi AiO settings.

Now in Divi AiO Settings make sure that SVG Uploads is enabled and then Click on Save Settings.

After enabling SVG Uploads now if you try to upload any SVG Image you will see that it’s not giving you the file type error.

You can see that the image is Uploaded without any error.

Now you can insert this SVG image anywhere you want. And if I select this image from Media Library as I am editing page.

You can see that the image is inserted on that page.

And if you want to do this same without installing our plugin you can do that by pasting this code in your Child theme’s function.php file.



// Allow SVG uploads

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

And don’t forget to use a Child Theme. Because when you do it in your main theme all the changes will be gone when you update If you don’t know how to make a Child Theme you can generate your own from here

And that’s it for this quick tutorial I am very sure that it helps you. If you have any problem feel free to ask in the Comment section.

And if you need an image to check SVG upload you can download it from here.

Image by Vexels.