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.
What it does
Section titled “What it does”- Adds
svg/svgz(image/svg+xml) to upload mimes for users withmanage_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, andon*/ 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.
When to use it
Section titled “When to use it”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.
When not to use it
Section titled “When not to use it”How to enable it
Section titled “How to enable it”- Go to WP PowerSuite -> Modules.
- Open Media or search for “SVG Upload”.
- Toggle SVG Upload on. No settings panel is required.
How to test it
Section titled “How to test it”- As an administrator, upload a simple
.svgvia 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.
Troubleshooting
Section titled “Troubleshooting”- Upload rejected for admin. File may be invalid XML, gzipped incorrectly, or over 5 MB.
- Editors cannot upload. Expected - capability is
manage_optionsonly. - 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.