Fix the File Type is Not Permitted error

How to Fix “Sorry, This File Type Is Not Permitted For Security Reasons”

Are you getting a ‘file type is not permitted’ error in WordPress? The security settings in WordPress can limit the files that you can upload.

In this article, we’ll show you how to quickly solve the error, ‘Sorry, this file type is not permitted for security reasons’.

  1. Install the File Upload Types Plugin
  2. Allow Additional File Types in WordPress
  3. Add Custom File Types to WordPress

Our method is completely “no-code”, you don’t need to edit any files in WordPress. It also works on regular WordPress and multisite installations.

Create Your WordPress File Upload Form Now

What Is “Sorry, This File Type Is Not Permitted for Security Reasons” in WordPress?

“Sorry, this file type is not permitted for security reasons” means you’re trying to upload a file that WordPress doesn’t support. But you can easily fix this with a free WordPress plugin called File Upload Types.

WordPress only allows images, audio, documents, and video files to be uploaded, but that doesn’t mean other file types, like CSV, are a security risk. WordPress has simply locked down allowed files to stop hackers from uploading malicious content.

WPForms is the best WordPress Form Builder plugin. Get it for free!

File Upload Types lets you add more ‘allowed’ file types to WordPress. It’s easy to use and avoids editing files in WordPress, which can cause problems with your site.

How to Fix the “File Type Is Not Permitted” Error in WordPress

Let’s add your file extension to WordPress so you don’t see “sorry, this file type is not permitted for security reasons” any more. You don’t need to use an FTP client because we’ll be working entirely in the WordPress admin area.

At the end of the article, we also added some frequently asked questions on WordPress file types that you may find helpful.

Step 1: Install the File Upload Types Plugin

The first thing we need to do is install the File Upload Types WordPress plugin. This plugin is 100% free and was created by the same team that created WPForms.

To start, open up your WordPress dashboard and head to Plugins » Add New.

Add New plugin in WordPress

Search for the File Upload Types plugin in the search box at the top.

Search for the File Upload Types plugin

Click Install Now, and then click Activate.

Activate File Upload Types plugin to fix 'file type is not permitted' error

Great! Now let’s add the file types you need. The good news is that we aren’t going to need to use File Manager or edit any core WordPress files to do this.

2. Allow Additional File Types in WordPress

By default, WordPress only allows the following file types:

Category Extensions
Images .jpg .jpeg .png .gif .ico
Audio files .mp3 .wav .ogg .m4a
Documents .pdf .doc .docx .ppt .pptx .pps .ppsx.odt .xls .xlsx .psd
Video files .mp4 .m4v .mov .wmv .avi .mpg .ogv .3gp .3g2

This means you can’t upload common files types like .csv and .svg.

If the extension you want to upload isn’t on the list, we can search for it in the File Upload Types plugin to quickly enable it.

In the WordPress dashboard, click Settings » File Upload Types.

Click the File Upload Types WordPress menu to fix file type not allowed

The settings for the File Upload Types plugin will open in your browser.

File Upload Types plugin settings

On the left, you can see a list of preset file types. It’s easy to add any of these file types to WordPress.

To start, in the Search File Types box, search for the file type you want to add to the allowlist in WordPress.

In this example, we’re going to search for CAD file types.

Search for file type to fix file type not allowed error

All of the preset file types for CAD files along with their MIME types.

To allow any of these file types to be uploaded in WordPress, just check the box next to each one. Then scroll down and click the orange Save Settings button.

Select file types to add to the allowlist to fix the file type is not allowed error

When the page reloads, you’ll notice that the file types you selected are now listed in a new section titled Enabled.

These will no longer trigger the ‘Sorry, this file type is not permitted for security reasons’ warning.

Fixed 'sorry, this file type is not permitted for security reasons'

That’s it! Now when you upload these files, you won’t get the ‘sorry, this file type is not permitted for security reasons’ message.

You might want to add more file types to the allowlist. For example, jump to this guide to accept Adobe Illustrator (AI) file uploads in WordPress.

Next up, let’s look at creating custom file types for files that aren’t on the preset list.

3. Add Custom File Types to WordPress

If the file type you want to upload isn’t listed in the File Upload Types plugin, you can add it as a custom file type easily. To do this, you’ll need to know the MIME type for the file.

MIME types are sometimes called internet file types. The MIME type describes the actual contents of the file. We can easily find the MIME type using the MIME file type checker.

Upload a file similar to the one you want to accept. The tool will look at the first few bytes and report the file type.

Check the MIME type for file not permitted error

That’s it! Now you know the MIME type.

In this example, let’s add the .heif file format so users can upload smartphone images to your WordPress site.

Start in the File Upload Types plugin. At the top, click the Add your custom file types link to add the new extension to the list of permitted file types.

Add custom MIME type to fix file type is not allowed error

You’ll see the Add custom file types section now. This is where you can add as many additional file types as you need.

For this file type, we’re going to type in:

  • A description for the custom file type – you can type anything you want here
  • The MIME type (if you need to add more than 1, separate them with a comma)
  • The file extension, including the leading period .

In this example, the MIME type for a .heif file is image/heif, so let’s go ahead and add that as a custom file type.

Custom file upload type added to WordPress

Once that’s done, click Save Settings.

Your custom file type will be listed in the Enabled section in the plugin.

Heif uploads enabled in WordPress

Now we can go ahead and upload these image files without getting the ‘sorry, this file type is not permitted for security reasons’ error in WordPress.

And that’s it! Now you know how to enable unsupported file types in WordPress.

Create Your WordPress File Upload Form Now

Frequently Asked Questions on File Upload Security

In this section, we’ll look at some additional questions on file upload types in WordPress.

How Do I Upload Files to WordPress?

To create a file upload form, you need WPForms. It’s the best file upload plugin for WordPress and lets you accept different types of files.

WPForms comes with a file upload form template and lets you create customized file upload forms easily without writing any code.

You can use the WPForms ‘Modern’ style file upload field to let visitors drag and drop files onto your forms. They can see the filename and a preview thumbnail instantly:

Modern file upload drag and drop

And with WPForms, you can also:

Can I Allow Any File Extension Using the File Upload Types Plugin?

Yes, the File Upload Types plugin allows you to upload any file type you want – even executable files. This means you can accept any upload without seeing ‘Sorry, this file type is not permitted for security reasons’.

However, unless you’re an expert user, we don’t recommend that you allow executable files to be uploaded to WordPress. It gives hackers an easy way to infect your site with malware, so it’s a definite security issue.

Also, keep in mind that some file types could still be blocked for 2 reasons:

  • Your form builder plugin may still block files for security reasons. For example, WPForms will always block executable files like .exe .msi and .html, ignoring the settings in the File Upload Types plugin.
  • Sometimes your web hosting provider won’t let users upload file types on its own blocklists.

What Does MIME Mean?

MIME stands for ‘multipurpose internet mail extensions’. It was originally developed to allow media files to be sent via email. The MIME header in a file tells the computer how to process or display the contents of the file.

What Does “This File Was Not Uploaded. File Type Not Allowed” Mean?

You might see this error in WordPress after adding unsupported file types. It usually means that the MIME type doesn’t match the file you’ve tried to upload.

To fix this, check that you have the correct MIME type associated with your custom file type. You can use the MIME type checker in Step 3 (above) to do this.

Can I Block Specific File Types on Specific Forms?

Yes, in WPForms you can specify which file types you want to allow on a specific form.

To do that, click on the File Upload field to edit the settings. Type in the extensions you want to allow in the Allowed File Extensions box.

Be sure to use the correct format for the upload settings. Start each extension with a period . and separate multiple extensions with a comma ,

Choose the file extensions on your file upload form

You can also specify a maximum file size for the file upload. By default, WPForms will use the maximum file size allowed on your server. If you’re not sure what this is, you can hover your mouse over the tooltip next to the field.

Allow file types on file upload form in WordPress

If the maximum file size setting is too low, you’ll want to increase it on your server. We recommend that you reach out to your web hosting provider for assistance.

Can I Allow Unsupported File Types Without a Plugin?

Yes, you can allow any files to be uploaded by editing your site’s wp-config.php or the WordPress theme’s functions.php file.

In the wp-config.php file, the following code allows all uploads without any filtering at all:

define('ALLOW_UNFILTERED_UPLOADS', true);

Keep in mind that this code presents a serious security risk. It allows hackers to upload any type of file to your website, so it’s definitely not a method we recommend.

It’s much safer to use the File Upload Types plugin because it lets you allow only the file types that you need, and it means you won’t need to worry about overwriting your changes when you update WordPress in the future.

Create Your WordPress File Upload Form Now

Next Step: Add a Dropbox File Upload Form

Would you like to automatically send file uploads to a cloud storage service? Check out this article on how to add a Dropbox file upload form in WordPress. This can help you to store uploaded files in the cloud if you don’t want to keep them on your web server, or in the Media Library.

Ready to build your form? Get started today with the easiest WordPress form builder plugin. WPForms Pro includes a file upload form template and offers a 14-day money-back guarantee.

If this article helped you out, please follow us on Facebook and Twitter for more free WordPress tutorials and guides.

Using WordPress and want to get WPForms for free?

Enter the URL to your WordPress website to install.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.