SVG Uploads in WordPress (the Inconvenient Truth)
Bjørn Johansen covers why:
- It’s easy to enable SVG uploads in WordPress (few lines to a functions.php file or functionality plugin)
- It makes sense why WordPress doesn’t allow them by default.
Jake Archibald in the comments:
In hindsight there probably should have been two content types, one that treats SVG has a full document context, and the other as a simple image (how browsers treat SVG in today, which cannot execute script or initiate fetches).
I also had someone tell me: “I’d buy your new book, but WordPress doesn’t allow SVG, and I work in WordPress.” To which I’d say, it’s only the media uploader that disallows them, and as the article covers, it’s easy to enable them (as long as you’re aware of the risks). But you can use SVG to your heart’s content as part of the theme.