An SVG logo stays sharp on every screen and weighs a few kilobytes. Yet WordPress refuses SVG uploads by default.
Why WordPress blocks SVG
An SVG is a text file that can contain scripts. Uploaded as is, a malicious file could run code in the browser of whoever opens it.
Clean every file
The safe approach is to rebuild each file with only known SVG tags, and remove scripts, event handlers and external links before it is saved.
Limit who can upload
Administrators by default. Open it to editors only if they need it.
Export clean files
In your design tool, outline fonts, remove hidden layers and export as plain SVG.
Set a size
SVG files have no fixed size. A viewBox and real dimensions let themes and blocks display them correctly.
Svgly cleans every SVG on upload and fixes previews. See the demo and SVG or PNG.
Frequently asked questions
Is it safe to allow SVG uploads?
Yes, if every file is cleaned on upload and only trusted roles can upload.
Can I use an SVG as the site logo?
Yes, once uploads are allowed, in the Site Logo block or the theme settings.
Do SVG files work in all browsers?
Yes, all modern browsers display them.