WordPress GuideErrors → Sorry File Type Not Permitted for Security Reasons

‘Sorry, this file type is not permitted for security reasons’ and how to fix it

Your guide to bare metal management best practices.

You’re uploading a file to WordPress, and instead of seeing it in your Media Library, you get a frustrating error: “Sorry, this file type is not permitted for security reasons.” Now what?

Don’t worry—this is a common error with several easy fixes. Whether you’re uploading an SVG, a custom font, or a file from a graphic design app, this guide will show you how to safely get it into your WordPress site.

What this error means (and why it happens)

WordPress restricts the types of files you can upload by default. This is a security feature designed to prevent users from accidentally or intentionally uploading malicious files that could harm your site.

Behind the scenes, WordPress checks every file’s MIME type—a label that tells the browser or server what kind of file it is. For example, a JPEG image uses image/jpeg, while a PDF uses application/pdf.

If the file you’re uploading doesn’t match WordPress’s approved list of file types, the upload will fail and trigger the “not permitted” error. This helps keep sites secure but can also block legitimate file types you need to use.

Common file types that trigger this error

Here are some file types that often get blocked by WordPress, even if they seem harmless:

If you’re trying to upload one of these file types, or any other uncommon format, WordPress might throw the file type error.

6 ways to fix the error in WordPress

Below are six reliable ways to fix the “file type not permitted” error. Choose the method that best fits your skill level and site needs.

1. Enable unfiltered uploads via wp-config.php (quickest but risky)

If you want a fast fix and you’re the only person who manages the site, you can allow all file types temporarily.

Important: This setting only works for admin users, and it completely disables file type restrictions. It’s not recommended on multi-user sites or long term. Once you’re done uploading the file, remove the line to restore security.

2. Use the File Upload Types plugin (safe and beginner-friendly)

For a secure and beginner-friendly option, the File Upload Types plugin lets you whitelist specific file types without editing code.

Now you can upload that file type without triggering the error, and your site stays secure.

3. Modify functions.php to allow specific MIME types

If you’re comfortable adding a few lines of code, you can add support for specific file types directly in your theme’s functions.php file.

Note: If your theme gets updated, this file might be overwritten. A safer long-term option is using a child theme or a custom plugin.

4. Use a custom plugin to manage MIME types

Instead of editing your theme, you can place the same code into a simple plugin that won’t be affected by theme updates.

This method makes your MIME type changes permanent and independent of your theme.

5. Temporarily disable security plugins

Some security plugins—like Wordfence, iThemes Security, or Sucuri—add extra restrictions on file uploads.

If nothing else is working:

Look for options like “Upload File Restrictions” or “Disallowed File Types” and adjust them to suit your needs.

6. Check hosting-level restrictions

If none of the above options work, your hosting provider may be blocking the file type at the server level. This can happen with managed hosts or if your server uses strict MIME-type settings in Apache or NGINX.

In this case:

How to securely enable SVG uploads (special case)

SVG files are unique because they’re code-based, which means they can contain malicious scripts if not sanitized.

To upload SVGs safely, use the Safe SVG plugin:

Alternatively, use an external tool like SVGOMG to clean up and sanitize your SVG files before uploading.

Should you enable all file types?

Not always. Allowing arbitrary file uploads can expose your site to major security risks, especially if you have multiple users.

Instead:

How to prevent this error in the future

A few habits can help you avoid this error going forward:

Additional resources

Diagnosing WordPress errors on your site →

Even more common errors, how to troubleshoot them, and how to solve them

Locked out of WordPress? Here’s how to fix it →

Locked out of WordPress? Discover common causes and step-by-step solutions to regain access.








What is managed WordPress hosting? →

What it means, what it includes, and how to decide if it’s right for you