Skip to content

SVG Upload

SVG Upload lets administrators add SVG and SVGZ files to the Media Library. Files are sanitized before they are stored; other roles cannot upload them.

  • Adds svg / svgz (image/svg+xml) to upload mimes for users with manage_options.
  • Blocks classic and REST uploads for non-admins with SVG uploads are restricted to administrators.
  • Sanitizes SVG XML: strips dangerous tags (script, foreignObject, iframe, and related), external <use> hrefs, unsafe styles, and on* / javascript/data URLs.
  • Rejects invalid or oversized files (max 5 MB) with File is not a valid SVG.
  • Skips intermediate image sizes for SVG attachments and improves Media Library preview sizing.

Enable it if:

  • Designers need vector logos and icons in the Media Library.
  • Only trusted administrators upload media.
  • You want built-in sanitization instead of a separate SVG plugin.
  1. Go to WP PowerSuite -> Modules.
  2. Open Media or search for “SVG Upload”.
  3. Toggle SVG Upload on. No settings panel is required.
  • As an administrator, upload a simple .svg via Media -> Add New.
  • ✅ Pass: file appears in the library and can be inserted into content.
  • As an Editor (or other non-admin), try the same upload.
  • ✅ Pass: error that SVG uploads are restricted to administrators.
  • Upload an SVG that contains a <script> tag.
  • ✅ Pass: upload succeeds only after sanitization removes the script (or fails if the file is invalid).
  • ❌ Fail: confirm the module is on and you are logged in as an administrator.
  • Upload rejected for admin. File may be invalid XML, gzipped incorrectly, or over 5 MB.
  • Editors cannot upload. Expected - capability is manage_options only.
  • No thumbnail sizes. Expected - SVG skips intermediate sizes by design.
What does SVG Upload do?

It lets administrators upload SVG and SVGZ files, sanitizes them, and blocks non-admin uploads.

Is SVG Upload free?

Yes. Enable it under WP PowerSuite -> Modules.

Does SVG Upload need configuration?

No. SVG and SVGZ uploads are allowed for administrators only. No settings required.

Who can upload SVGs?

Only users with manage_options (administrators). Others get SVG uploads are restricted to administrators.

How do I turn SVG Upload off?

Go to WP PowerSuite -> Modules, find SVG Upload, and toggle it off.

Developer notes (hooks & filters)

Source: modules/svg-upload/module.php. Boot: display · context: admin, rest, ajax.

Hooks: upload_mimes, wp_handle_upload_prefilter, rest_pre_upload_file, wp_check_filetype_and_ext, intermediate_image_sizes_advanced, wp_prepare_attachment_for_js.