How to Fix the “Sorry, This File Type Is Not Permitted for Security Reasons” Error in WordPress
Last updated
Last updated
This manual shows how to fix “Sorry, This File Type Is Not Permitted for Security Reasons” Error in your site
If you tried to upload the file to the media library and received the error message “Sorry, this file type is not allowed for security reasons”, you may feel confused about what to do next. Fortunately, this is one of the most common mistakes that users face. Let's start!
Well, whenever you try to upload a file in a format other than acceptable, you will definitely get this error. By default, WordPress allows you to upload images in .gif, .png, .jpg, and .jpeg formats; documents in .xls and .xlsx, .pdf, .ppt, .pptx, .pps and .ppsx, .doc and .docx and .odt formats; audio in .flv, .mp3, .m4v, .wma, .m4a, .mid, .ogg, .mp4, .wma, and .mid audio formats, as well as .ogv, .mp4, .3gp, .m4v, .avi, .mov, .3g2, .webm, .wmv and .mpg. In addition, other file formats are allowed, such as .zip and .key. Thus, whenever you try to upload a file in a format other than the above, WordPress gives an error. Now let's see how to fix it.
When it comes to this particular error, you have many options to fix it. Depending on your situation, one of the methods listed below should provide a simple solution.
Multisite has a setting that makes it easy to allow file uploads, usually not allowed by WordPress. To access it, go to the network settings in the “Settings” section of the network administrator panel:
Under the “Download Options” heading, you will find the “File Download Types” input area which you can add extensions for the types of files you want to allow.
After saving these changes, this will update the permitted file types for all the sites in your network, enabling you and your users to upload any file types included in this setting.
You can easily fix the error using WordPress plugins. There are various plugins which you can use. For example, WP Add Mime Types.
After installing the plugin, you need to add allowed mime types from the Dashboard ▸ Settings ▸ Mime Type Settings area
If the above plugins don’t work for you, you can also edit the wp-config.php file and allow it to upload all file extensions.
IMPORTANT: It’s not a recommended method as it will make your WordPress less secure. Once you have uploaded the file, be sure to revert changes made to the wp-config.php file.
All you need to do is:
Connect to your website using an FTP client or File Manager.
Access the WordPress installation directory and look for wp-config.php Open it for editing.
Paste the following line of code anywhere above the line that says ‘That’s all, stop editing! Happy blogging’:
define(‘ALLOW_UNFILTERED_UPLOADS’, true);
If you have already completed all of the above steps, but nothing has helped, it may be time to contact your hosting provider. Sometimes hosting providers limit certain file formats for security, and they can better help you with this.