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

As the message implies, WordPress limits the types of files that you can upload to your site for security reasons. Even so, by adding a modest code snippet to your site's wp-config.php file or using a free plugin, yous can manually aggrandize the list of allowed file types so that you're able to upload any type of file.

Here'southward what you'll acquire in this article:

  • More near the "Deplorable, this file type is not permitted for security reasons" message
  • How to fix the "Lamentable, this file type is non permitted for security reasons" bulletin in WordPress

What Triggers the "Sorry, this file type is not permitted for security reasons" Bulletin?

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

Equally we explained above, WordPress' default configuration limits the types of files that you can upload to your site for security reasons.

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

Images:

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

(Suggested reading: JPG vs JPEG: Understanding the Most 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

Audio:

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

If you're trying to upload a file type that's non on the list above, you're likely going to run into the "Sorry, this file type is not permitted for security reasons" mistake. Or, you lot'll likewise see it as "[filename] has failed to upload".

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

For example, if y'all're trying to use your own 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. Considering 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 yous upload them.

Here's an case 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 bulletin

How to Ready the "Pitiful, this file type is not permitted for security reasons" Fault in WordPress

Below, we'll show you two ways how to gear up the "Lamentable, this file type is non permitted for security reasons" mistake in WordPress:

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

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

WordPress includes an ALLOW_UNFILTERED_UPLOADS option that you can enable in your site's wp-config.php file. In one case enabled, you'll exist able to upload whatsoever file type to your WordPress Media Library.

Subscribe Now

Here's how to set it upward – but first, considering 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's wp-config.php file is located in the root folder, which is the same binder that has the wp-admin and wp-includes folders.

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

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

And then, while editing the wp-config.php file, add the post-obit 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 together the code in your wp-config.php file

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

To finish the process, you'll demand to go to your WordPress dashboard and log out of your WordPress business relationship. So, you tin immediately log back in.

Afterwards yous've logged out/in, you lot should be able to upload any file without triggering the error bulletin:

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

2. Use the Costless WP Extra File Types Plugin

If y'all'd adopt non to edit your wp-config.php file and/or y'all want more control over exactly which file types tin can exist uploaded to your site, you can utilise the gratuitous WP Actress File Types plugin at WordPress.org

One time you install and activate the plugin, go to Settings → Actress File Types in your WordPress dashboard.

There, you'll see a lengthy list of file types. Check the box next to the file type(s) that y'all want to be able to upload and and so click Save Changes at the bottom:

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

If you don't see the file type that you lot'd like to upload on the list, yous can also add your own custom file types at the lesser of the plugin's settings list:

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

Alternative Plugins

In some instances, there may be better 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 just enables the SVG filetype in the WordPress media library, information technology 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 try to upload a file type exterior this list of default file types, you'll meet 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, you tin also utilise the free WP Actress File Types plugin to control immune file types from your WordPress dashboard.

Finally, if, later on allowing new file types, you still can't upload your file because of its size, you lot might want to bank check out our additional 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 Mistake

And don't forget, you could as well upload the file via SFTP if needed.


Save time, costs and maximize site operation with:

  • Instant aid from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 29 data centers worldwide.
  • Optimization with our born Application Performance Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Bank check out our plans or talk to sales to find the program that'south correct for yous.