SVG files in WordPress Media

One of my designer partner is using lot of SVG icons in their designs but unfortunately WordPress can’t handle SVG by default. To enable SVG file uploads I use Safe SVG plugin.

Now you can upload SVGs but you have no preview in Media Library. I have a solution for that. Put the following snippet in your theme’s function.php file:

Now you can upload and see SVG files in your Media Library.

Close Menu