Are y'all trying to upload a file to your WordPress Media Library merely to exist met with a message telling you "Pitiful, this file blazon 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. All the same, by adding a small code snippet to your site's wp-config.php file or using a complimentary plugin, you tin can manually expand the listing of allowed file types and so that you're able to upload whatsoever type of file.

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

  • More about the "Distressing, this file blazon is not permitted for security reasons" message
  • How to gear up the "Sorry, this file type is not permitted for security reasons" bulletin in WordPress

What Triggers the "Sorry, this file type is not 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

Every bit we explained above, WordPress' default configuration limits the types of files that you 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 Well-nigh Common Image File Format)
Videos:

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

Documents:

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

Sound:

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

If yous're trying to upload a file blazon that'southward not on the list above, you're likely going to run into the "Sorry, this file type is non permitted for security reasons" error. Or, yous'll besides see information technology as "[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 y'all're trying to utilize 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 allowed past default, WordPress will prove yous the "Sorry, this file type is non permitted for security reasons" fault instead of letting yous 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 Fix the "Sorry, this file blazon is not permitted for security reasons" Error in WordPress

Below, we'll bear witness you lot two means how to ready the "Sorry, this file blazon is not permitted for security reasons" error in WordPress:

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

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

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

Subscribe At present

Here's how to set it upwards – but kickoff, considering you'll be editing your wp-config.php file, we'd recommend bankroll up your site before proceeding.

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

Correct-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

So, while editing the wp-config.php file, add the following code snippet above the /* That's 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 the code in your wp-config.php file

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

To finish the process, y'all'll need to go to your WordPress dashboard and log out of your WordPress account. Then, yous can immediately log back in.

After you lot'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

ii. Use the Gratis WP Actress File Types Plugin

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

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

At that place, you'll see a lengthy list of file types. Check the box next to the file type(south) that you want to be able to upload and then click Salvage 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 like to upload on the list, you tin too add your own custom file types at the bottom of the plugin'southward settings list:

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

Culling Plugins

In some instances, at that place may exist 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 only 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 tin upload to your site for security reasons. If yous try to upload a file blazon outside this listing of default file types, yous'll encounter the "Lamentable, this file type is non permitted for security reasons." message.

One fashion to fix the effect is to edit your wp-config.php file and add together the ALLOW_UNFILTERED_UPLOADS code snippet to allow unfiltered uploads. Or, you can also use the free WP Extra File Types plugin to command allowed file types from your WordPress dashboard.

Finally, if, subsequently allowing new file types, you still tin can't upload your file because of its size, yous might want to 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 Fault

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


Salvage time, costs and maximize site performance with:

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

All of that and much more, in i programme with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Bank check out our plans or talk to sales to detect the program that's right for you.