Even in December 2025, it is still not possible to upload SVG files to a WordPress website. As an SVG file can contain JavaScript code and is therefore considered a “potential security risk”, WordPress core does not allow the upload of SVG files. There are people trying to allow it in the future, while filtering out malicious code, but it will probably still take some time.
In the meantime, you can use a plugin or some custom code, to allow uploading an SVG to WordPress. In the 2015 advent calendar, I shared a snippet on how to allow the SVG upload (unfortunately, this blog post has not yet been translated to English).
But if you not only want to upload the SVG and use it in theme settings, but also put it into a post or page, I would recommend using a plugin that integrates SVG support better into WordPress. Here are two plugins I’ve used on different sites.
What does Safe SVG do?
The Safe SVG plugin is developed by 10up, a highly reputable WordPress agency. It not only allows you to upload an SVG, but also does something with the file. It sanitizes the SVG, which means that it tries to remove any code that might cause a security risk to your site. It also optimizes the SVG using the SVGO tool, which I also use (either in the browser or as an Inkscape extension) to get better and smaller files. With this plugin, you can also view SVG files in your media library (this is not possible, if you only allow the upload with a code snippet). And you can even decide the user roles that are allowed to upload SVG files.
What does SVG Support do?
The SVG Support plugin has almost the same features as Safe SVG, but it also adds some more options. One of them is “to inline” an SVG, which then allows you to modify the SVG using CSS. This is not possible, when the SVG is “loaded as an external image”. Such a styling can be useful if you want to change colors in an SVG in a “dark mode” for example.
Why do I use those plugins?
I use both plugins on one site each. On other sites, I only use the code snippet. It really comes down to your usage of SVG images in posts and pages. If you only want to use an SVG in the Customizer options for your site logo, the code snippet or Safe SVG might be all you need. If you want to use SVG images in your content, then the inline feature of SVG Support might be of use for you.
Conclusion
Both plugins have more than one million active installations, so we do see that people are using SVG files with their WordPress websites. It is about time to get SVG native support into WordPress Core and close this 13 years old Trac ticket I’ve linked above.
Do you use SVG files in your WordPress project? How to you use them? Only as static files bundled in themes and plugins? Or also in the content of posts and page? Then how do you allow the upload of them?