Skip to main content

Why Can't I Upload SVG Files to WordPress?

WordPress blocks SVG uploads by default for security reasons. Learn why SVG files are restricted, how to safely enable SVG support using plugins like Safe SVG, and troubleshoot common upload issues on your WordPress site.

Nick avatar
Written by Nick
Updated over a week ago

WordPress blocks SVG uploads by default for security reasons. This is standard WordPress behavior across all hosting providers, not a Wordify limitation.


What Are SVG Files?

SVG (Scalable Vector Graphics) files are XML-based images that stay sharp at any size. Unlike JPG or PNG files, SVGs are actually code that browsers interpret, which creates potential security vulnerabilities.


Why WordPress Blocks SVG Uploads

WordPress doesn't allow SVG uploads by default because SVG files can contain malicious JavaScript code. When you try to upload an SVG, you'll see this error:

"Sorry, this file type is not permitted for security reasons"

or

"Sorry, you are not allowed to upload this file type"


How to Enable SVG Support

The safest way to enable SVG uploads is by installing a security plugin that sanitizes the files.


Method 1: Install Safe SVG Plugin (Recommended)

  1. Log in to your WordPress admin dashboard

  2. Navigate to Plugins β†’ Add New

  3. Search for "Safe SVG"

  4. Click Install Now, then Activate

  5. The plugin automatically sanitizes all SVG uploads

That's it! You can now upload SVG files to your media library.


Method 2: Install SVG Support Plugin

This plugin offers more features including inline rendering and CSS styling:

  1. Log in to your WordPress admin dashboard

  2. Navigate to Plugins β†’ Add New

  3. Search for "SVG Support"

  4. Click Install Now, then Activate

  5. Go to Settings β†’ SVG Support

  6. Recommended settings:

    • Check "Restrict SVG Uploads to Administrators"

    • Check "Enable Advanced Mode" (if you need CSS styling)

    • Leave sanitization enabled for all roles

Why Some Sites Work and Others Don't

If SVG uploads work on some of your sites but not others, it's because:

  • Theme differences: Some themes include built-in SVG support, while others don't

  • Plugin differences: Working sites have an SVG plugin installed; blocked sites don't

  • Recent changes: An SVG plugin was deactivated or deleted during a recent update

Files Upload via FTP But Don't Show in Media Library

This happens when WordPress doesn't recognize the SVG file type. Installing an SVG plugin will fix this issue.

After installing the plugin:

  1. The files uploaded via FTP should now appear in your media library

  2. If they still don't appear, you may need to use a plugin like Regenerate Thumbnails to refresh your media library

Security Best Practices

When using SVG files on WordPress:

  • Only upload SVGs from trusted sources (designers you know and trust)

  • Restrict upload permissions to Administrators only (don't let all users upload SVGs)

  • Always use a sanitization plugin (don't manually enable SVG support without protection)

  • Keep plugins updated to ensure security patches are applied


Troubleshooting

Plugin Installed But Still Can't Upload

If you've installed an SVG plugin but still can't upload:

  1. Check for conflicts: Temporarily deactivate other security plugins (Wordfence, All-in-One Security, etc.)

  2. Clear cache: Clear your WordPress cache and browser cache

  3. Check permissions: Ensure your WordPress user role is Administrator

  4. Try a different SVG: Some complex SVGs may have issues - test with a simple SVG file

  5. Verify plugin is active: Go to Plugins and confirm the SVG plugin shows as "Active"

SVGs Not Displaying on Website

If SVGs upload successfully but don't display:

  1. Add this CSS to your theme:

    img[src$=".svg"] {    width: 100%;    height: auto;}
  2. Check that your SVG file has width and height attributes

  3. Try using the "SVG Support" plugin which includes display fixes

Need Help?

If you're still having trouble uploading SVG files after trying these solutions, please reach out and we'll help you get it sorted.
​

Remember: SVG support is managed at the WordPress level, not the server level. Wordify's servers don't block any file types - this is standard WordPress security behavior that requires a plugin to enable safely.

Did this answer your question?