
SVG Enabler lets you upload SVG files to the WordPress media library while making sure each file is safe.
SVG is an XML format, which means it can carry JavaScript, event handler attributes, external references and XML entities. Uploading an unsanitized SVG is equivalent to allowing arbitrary HTML and JavaScript uploads. This plugin sanitizes every SVG during upload, before the file is written to your uploads directory.
What gets removed
<script> elements and inline JavaScriptonload, onclick, onerrorjavascript: URLs in links and attributes<foreignObject> payloads<image>, <use>, href and xlink:hrefurl() and @import rules inside <style> blocksexpression() and behavior: declarationsFeatures
enshrined/svg-sanitize library (0.22.0+)