Are you trying to upload a file to your WordPress Media Library but to be met with a message telling y'all "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 tin can upload to your site for security reasons. However, by adding a pocket-sized code snippet to your site'southward wp-config.php file or using a costless plugin, you can manually expand the list of allowed file types so that you're able to upload any type of file.

Here'south what y'all'll larn in this article:

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

What Triggers the "Sorry, this file blazon is non permitted for security reasons" Message?

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

As nosotros explained above, WordPress' default configuration limits the types of files that y'all 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: Agreement the Nigh 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'southward not on the list in a higher place, you're likely going to run into the "Sorry, this file type is not permitted for security reasons" fault. Or, you'll also encounter information technology equally "[filename] has failed to upload".

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

For example, if you're trying to use your own 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 allowed by default, WordPress volition evidence you the "Sad, this file blazon is non 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 bulletin

How to Fix the "Sorry, this file type is non permitted for security reasons" Error in WordPress

Below, nosotros'll show you ii ways how to fix the "Distressing, this file blazon is not permitted for security reasons" error in WordPress:

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

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

WordPress includes an ALLOW_UNFILTERED_UPLOADS option that yous can enable in your site's wp-config.php file. Once enabled, you'll be able to upload whatsoever file blazon to your WordPress Media Library.

Subscribe Now

Here'due south how to set information technology up – but first, considering y'all'll be editing your wp-config.php file, we'd recommend bankroll up your site before proceeding.

To get started, connect to your WordPress site via FTP/SFTP. Your site'southward wp-config.php file is located in the root binder, which is the aforementioned 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

Then, while editing the wp-config.php file, add the post-obit code snippet above the /* That'southward 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 lawmaking in your wp-config.php file

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

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

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

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

2. Utilise the Free WP Extra File Types Plugin

If you'd adopt not to edit your wp-config.php file and/or you desire more than command over exactly which file types can be uploaded to your site, you can use the gratuitous WP Extra File Types plugin at WordPress.org

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

There, you'll see a lengthy listing of file types. Cheque the box side by side to the file blazon(due south) that you want 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 allow file types in the plugin's settings

If you don't see the file type that you'd similar to upload on the list, yous tin can also add your ain custom file types at the bottom of the plugin'south settings list:

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

Alternative Plugins

In some instances, there 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 gratis Safe SVG plugin. This not just enables the SVG filetype in the WordPress media library, it besides sanitizes them upon upload.

Summary

By default, WordPress limits the file types that you can upload to your site for security reasons. If y'all effort to upload a file type outside this list of default file types, y'all'll run into the "Deplorable, this file type is not permitted for security reasons." message.

One manner to set up the outcome is to edit your wp-config.php file and add the ALLOW_UNFILTERED_UPLOADS code snippet to allow unfiltered uploads. Or, you tin can as well use the costless WP Extra File Types plugin to control immune file types from your WordPress dashboard.

Finally, if, later on assuasive new file types, you however can't upload your file considering 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, 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 information 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 30-solar day-money-back-guarantee. Cheque out our plans or talk to sales to find the programme that'southward right for you lot.