Are you trying to upload a file to your WordPress Media Library only to be met with a message telling you "Distressing, this file type is not permitted for security reasons" and/or "[filename] has failed to upload"?

Every bit the message implies, WordPress limits the types of files that you lot tin can upload to your site for security reasons. However, by calculation a small lawmaking snippet to your site'south wp-config.php file or using a free plugin, you can manually aggrandize the listing of allowed file types so that y'all're able to upload any type of file.

Here's what you'll larn in this article:

  • More than most the "Sad, this file type is not permitted for security reasons" message
  • How to fix the "Sorry, this file blazon is not permitted for security reasons" message in WordPress

What Triggers the "Distressing, this file type is non permitted for security reasons" Message?

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

Every bit nosotros explained above, WordPress' default configuration limits the types of files that yous can upload to your site for security reasons.

By default, the file types that you can upload are:

Images:

  • .jpg
  • .jpeg
  • .png
  • .gif
  • .ico

(Suggested reading: JPG vs JPEG: Understanding the Virtually Common Prototype File Format)
Videos:

  • .mp4
  • .m4v
  • .mov
  • .wmv
  • .avi
  • .mpg
  • .ogv
  • .3gp
  • .3g2

Documents:

  • .pdf
  • .doc
  • .ppt, .pptx, .pps, .ppsx
  • .odt
  • .xls, .xlsx
  • .psd

Sound:

  • .mp3
  • .m4a
  • .ogg
  • .wav

If you lot're trying to upload a file type that's not on the list above, you're likely going to see the "Lamentable, this file type is not permitted for security reasons" error. Or, you'll also see it equally "[filename] has failed to upload".

Are you trying to upload a file on WordPress and continue getting the 'Distressing, This File Type Is Non Permitted for Security Reasons' error? Larn how to set it! 🛠️ Click to Tweet

For example, if you're trying to utilise your ain custom fonts on your WordPress site, you might be trying to upload a custom font file to WordPress in the .tff and/or .woff formats. Because those formats are not immune past default, WordPress will bear witness y'all the "Sorry, this file blazon is not permitted for security reasons" error instead of letting you upload them.

Here's an example where we tried to upload a .woff file to our test site:

Uploading a .woff file triggers the message
Uploading a .woff file triggers the message

How to Set the "Sorry, this file type is not permitted for security reasons" Mistake in WordPress

Below, we'll show you two means how to set up the "Sad, this file type is not permitted for security reasons" mistake in WordPress:

  1. By editing your site'due south wp-config.php file
  2. By using a complimentary WordPress plugin

1. Add New Permitted File Types Using wp-config.php

WordPress includes an ALLOW_UNFILTERED_UPLOADS option that you tin enable in your site'due south wp-config.php file. Once enabled, y'all'll exist able to upload any file type to your WordPress Media Library.

Subscribe Now

Here'south how to fix information technology up – only first, because you'll be editing your wp-config.php file, we'd recommend backing upward your site before proceeding.

To get started, connect to your WordPress site via FTP/SFTP. Your site'due south wp-config.php file is located in the root binder, which is the same folder that has the wp-admin and wp-includes folders.

Right-click to edit the file, or download information technology to your reckoner:

How to edit your wp-config.php file
How to edit your wp-config.php file

Then, while editing the wp-config.php file, add the post-obit code snippet above the /* That'due south all, stop editing! Happy blogging. */ line:

define('ALLOW_UNFILTERED_UPLOADS', true);

Where to add the code in your wp-config.php file
Where to add together the code in your wp-config.php file

Make sure to save your changes and re-upload the file if needed.

To finish the process, you'll demand to become to your WordPress dashboard and log out of your WordPress account. Then, you can immediately log back in.

After y'all've logged out/in, you should be able to upload whatsoever file without triggering the error message:

Successfully uploading a .woff file
Successfully uploading a .woff file

2. Use the Gratuitous WP Extra File Types Plugin

If you'd prefer not to edit your wp-config.php file and/or you want more control over exactly which file types can exist uploaded to your site, you can employ the free WP Actress File Types plugin at WordPress.org

One time y'all install and activate the plugin, go to Settings → Extra File Types in your WordPress dashboard.

There, you'll see a lengthy list of file types. Bank check the box next to the file type(s) that you desire to be able to upload and then click Save Changes at the bottom:

How to allow file types in the plugin's settings
How to let file types in the plugin's settings

If you don't run into the file blazon that y'all'd like to upload on the list, you can also add your own custom file types at the lesser of the plugin's settings listing:

How to add your own custom file type
How to add your own custom file type

Alternative Plugins

In some instances, there may be amend alternative plugins to enable specific file types. For instance, in our tutorial on how to enable SVGs in WordPress, nosotros recommend the free Safe SVG plugin. This not only enables the SVG filetype in the WordPress media library, it also sanitizes them upon upload.

Summary

By default, WordPress limits the file types that you can upload to your site for security reasons. If you endeavour to upload a file type outside this list of default file types, you'll see the "Lamentable, this file type is not permitted for security reasons." message.

One mode to fix the issue is to edit your wp-config.php file and add together the ALLOW_UNFILTERED_UPLOADS lawmaking snippet to allow unfiltered uploads. Or, you tin likewise use the free WP Extra File Types plugin to control allowed file types from your WordPress dashboard.

Finally, if, afterwards assuasive new file types, you still tin can't upload your file because of its size, you might want to check out our additional guides on:

  • How to Increment the WordPress Maximum Upload File Size
  • How to Fix the uploaded file exceeds the upload_max_filesize directive in php.ini Error

And don't forget, y'all could besides upload the file via SFTP if needed.


Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience accomplish with 29 data centers worldwide.
  • Optimization with our built-in Application Performance Monitoring.

All of that and much more than, in one program with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Check out our plans or talk to sales to find the plan that'southward right for you.