Appearance
Enable SVG Uploads
WordPress blocks SVG uploads by default because an SVG is executable markup — it can carry JavaScript. This allows them, and sanitizes each file on upload to strip the dangerous parts.
No settings. Enable it under Voxel Toolkit → Functions and SVG uploads start working.
Why WordPress blocks SVGs
An SVG isn't really an image — it's an XML document that a browser renders, and it can contain <script> tags, event handlers, and external references. An attacker who can upload one to your media library can potentially run JavaScript in an administrator's browser.
This function allows the upload but runs each file through sanitization first, removing scripts and event handlers before the file is stored.
Sanitization reduces risk, it doesn't eliminate it
Only give SVG upload ability to users you trust. If contributors or subscribers can upload media on your site, think carefully about whether they need SVG — the safest configuration is still not allowing untrusted users to upload them at all.
What to use SVGs for
- Logos and icons — sharp at any size, and usually far smaller than a PNG
- Simple illustrations and line art
- Anything needing to scale — a single SVG replaces multiple raster sizes
Photographs are not a good fit; use WebP or JPEG, and see Image Optimization.
Troubleshooting
Uploads still rejected
- Confirm the function is enabled and the page has been reloaded
- Check for a security plugin independently blocking SVG — Wordfence and similar have their own filters
- Some hosts block SVG at the server or WAF level, above WordPress
The SVG uploads but doesn't display
- It may lack a
viewBox, so it has no intrinsic size. Add one, or set explicit width and height in CSS. - Sanitization may have removed something the file depended on — an external reference or an embedded script driving the rendering. Re-export it as a static, self-contained SVG.
It shows no thumbnail in the media library
Normal. WordPress can't generate raster thumbnails for SVG, so the library shows a generic icon. The file itself is fine.

