best plugin to allow non secure file type upload to media library
Are yous trying to upload a file to your WordPress Media Library simply to exist met with a message telling y'all "Sad, 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. However, by adding a small lawmaking snippet to your site's wp-config.php file or using a free plugin, you can manually expand the list of allowed file types so that you're able to upload whatever type of file.
Here's what you'll learn in this commodity:
- More than about the "Pitiful, 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 "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 yous tin upload to your site for security reasons.
The "Sorry, This File Type Is Not Permitted for Security Reasons" Mistake Message in WordPress:
You get the "Sorry, This File Type Is Not Permitted for Security Reasons" fault message when you lot endeavor to upload a file type that's not supported in WordPress by default.
WordPress limits the file types you can upload through your site's admin — images, videos, documents, sound — for security reasons.
By default, the file types that you lot can upload are:
Images:
- .jpg
- .jpeg
- .png
- .gif
- .ico
(Suggested reading: JPG vs JPEG: Understanding the About Common Image File Format)
Videos:
- .mp4
- .m4v
- .mov
- .wmv
- .avi
- .mpg
- .ogv
- .3gp
- .3g2
Documents:
- .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 listing above, you're probable going to come across the "Sorry, this file type is not permitted for security reasons" error. Or, you'll likewise see it as "[filename] has failed to upload".
For instance, if you'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 non immune by default, WordPress will show you the "Sorry, this file blazon is non permitted for security reasons" error instead of letting you upload them.
Hither'south an case where we tried to upload a .woff file to our test site:
How to Fix the "Sorry, this file type is non permitted for security reasons" Error in WordPress
Beneath, we'll show y'all ii ways how to fix the "Distressing, this file type is non permitted for security reasons" error in WordPress:
- By editing your site'due south wp-config.php file
- Past using a free WordPress plugin
one. Add 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 be able to upload any file type to your WordPress Media Library.
Subscribe Now
Here's how to set it up – only first, because yous'll exist editing your wp-config.php file, we'd recommend bankroll 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 binder, which is the aforementioned binder that has the wp-admin and wp-includes folders.
Correct-click to edit the file, or download it to your computer:
Then, 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', truthful);
Make sure to salve your changes and re-upload the file if needed.
To finish the process, you lot'll need to get to your WordPress dashboard and log out of your WordPress account. Then, you can immediately log dorsum in.
Later y'all've logged out/in, yous should be able to upload any file without triggering the error message:
2. Utilize the Complimentary WP Extra File Types Plugin
If you lot'd prefer not to edit your wp-config.php file and/or you want more control over exactly which file types can be uploaded to your site, you tin apply the gratis WP Extra File Types plugin at WordPress.org
Once you install and actuate the plugin, get to Settings → Extra File Types in your WordPress dashboard.
There, y'all'll see a lengthy list of file types. Check the box next to the file type(southward) that you want to be able to upload and so click Salvage Changes at the bottom:
If you don't see the file type that you'd like to upload on the list, you tin also add your ain custom file types at the bottom of the plugin'due south settings list:
Alternative Plugins
In some instances, at that place 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 gratuitous Safety SVG plugin. This not just enables the SVG filetype in the WordPress media library, it too sanitizes them upon upload.
Summary
By default, WordPress limits the file types that y'all can upload to your site for security reasons. If you endeavor to upload a file blazon outside this list of default file types, you'll encounter the "Sorry, this file type is not permitted for security reasons." bulletin.
One fashion to fix the issue 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 apply the costless WP Extra File Types plugin to control allowed file types from your WordPress dashboard.
Finally, if, after assuasive new file types, you however tin can't upload your file because of its size, you might desire 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 Error
And don't forget, you could also upload the file via SFTP if needed.
Save fourth dimension, costs and maximize site performance with:
- Instant assist from WordPress hosting experts, 24/7.
- Cloudflare Enterprise integration.
- Global audience reach with 29 data centers worldwide.
- Optimization with our built-in Awarding Functioning 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. Check out our plans or talk to sales to discover the plan that'due south right for you.
Source: https://kinsta.com/knowledgebase/sorry-this-file-type-is-not-permitted-for-security-reasons/
0 Response to "best plugin to allow non secure file type upload to media library"
Post a Comment