Are you trying to upload a file to your WordPress Media Library only to be met with a message telling you "Sorry, this file blazon is non 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 can upload to your site for security reasons. Nonetheless, past adding a small code snippet to your site's wp-config.php file or using a complimentary plugin, you lot can manually aggrandize the list of immune file types so that you're able to upload any blazon of file.

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

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

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

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

As we explained to a higher place, WordPress' default configuration limits the types of files that y'all can upload to your site for security reasons.

Past default, the file types that y'all can upload are:

Images:

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

(Suggested reading: JPG vs JPEG: Understanding the Most Common Image File Format)
Videos:

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

Documents:

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

Audio:

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

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

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

For case, if you're trying to utilise your ain custom fonts on your WordPress site, yous might be trying to upload a custom font file to WordPress in the .tff and/or .woff formats. Because those formats are not immune by default, WordPress volition prove you the "Sorry, this file type is not permitted for security reasons" mistake instead of letting you upload them.

Here's an example where nosotros 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 Gear up the "Sorry, this file type is not permitted for security reasons" Error in WordPress

Below, nosotros'll show you two means how to fix the "Sorry, this file type is not permitted for security reasons" error in WordPress:

  1. Past editing your site's wp-config.php file
  2. By using a free WordPress plugin

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

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

Subscribe At present

Here'south how to set it upward – but offset, because you'll be editing your wp-config.php file, we'd recommend backing upwards your site before proceeding.

To get started, connect to your WordPress site via FTP/SFTP. Your site'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 it to your computer:

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

And so, while editing the wp-config.php file, add the following code snippet above the /* That's all, terminate editing! Happy blogging. */ line:

define('ALLOW_UNFILTERED_UPLOADS', true);

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

Brand certain to save your changes and re-upload the file if needed.

To cease the process, you'll need to become to your WordPress dashboard and log out of your WordPress account. Then, you lot tin immediately log back in.

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

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

2. Utilize the Gratuitous WP Actress 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 tin be uploaded to your site, you can use the free WP Actress File Types plugin at WordPress.org

In one case you install and actuate the plugin, go to Settings → Actress File Types in your WordPress dashboard.

In that location, you'll see a lengthy listing of file types. Check the box side by side to the file type(s) that you want to be able to upload and then click Salve Changes at the lesser:

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

If you don't see the file blazon that you'd like to upload on the list, you lot can as well add your own custom file types at the lesser of the plugin'southward settings list:

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

Alternative Plugins

In some instances, in that location may be meliorate alternative plugins to enable specific file types. For example, in our tutorial on how to enable SVGs in WordPress, we recommend the free Safe SVG plugin. This not simply enables the SVG filetype in the WordPress media library, it also sanitizes them upon upload.

Summary

By default, WordPress limits the file types that yous can upload to your site for security reasons. If you try to upload a file type outside this list of default file types, you'll run across the "Sorry, this file blazon is non permitted for security reasons." message.

One way to fix the issue is to edit your wp-config.php file and add the ALLOW_UNFILTERED_UPLOADS code snippet to allow unfiltered uploads. Or, y'all tin also employ the free WP Extra File Types plugin to control immune file types from your WordPress dashboard.

Finally, if, later on allowing new file types, you withal can't upload your file because of its size, you might want to bank check out our boosted guides on:

  • How to Increase 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, you could also 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, in one plan with no long-term contracts, assisted migrations, and a thirty-day-money-back-guarantee. Check out our plans or talk to sales to detect the plan that's right for you.