How To Fix “Sorry, This File Type Is Not Permitted For Security Reasons”

Wp Depend Blogg Post

Whenever you attempt to upload a file to your WordPress Media Library, you may receive an error message stating that “Sorry, this file type is not permitted for security reasons” or “[filename] has failed to upload.” This is typically the result of WordPress’ default restriction on the upload of certain file types, such as MIME types, or “Media types.” Fortunately, there are a few methods to allow uploads of other file types, and in this post, we’ll walk you through how to do just that.

The error Sorry, this file type is not permitted for security reasons appears when you try to upload a file that WordPress doesn’t allow ‘out of the box’.Other file formats, such as CSV, are not inherently unsafe. WordPress has restricted file uploads to only what is necessary for the majority of users.

File type: format

Images: .jpg .jpeg .png .gif .ico

Audio files: .mp3 .wav .ogg .m4a

Documents: .pdf .doc .docx .ppt .pptx .pps .ppsx.odt .xls .xlsx .psd

Video files: .mp4 .m4v .mov .wmv .avi .mpg .ogv .3gp .3g2

These settings can be relaxed to allow legitimate files to be uploaded.

Verify and Adjust the Spelling of the File Type Extension

Before making any changes to your WordPress files or settings, make sure to check the extension of the file you are trying to upload. It’s likely that you mistakenly altered the extension when you saved the file.

The first thing you should do if you receive this issue is make sure the file extension is right. It is possible to mistakenly erase or insert the wrong file name extension when editing or saving a file on your computer. Therefore, before uploading the file, you must verify and fix the spelling of the file type extension.

Edit the wp-config.php File to Upload Any File Type

You can add a one-liner code to your wp-config.php file to upload any type of file extension to your website. First, make a backup of your wp-config.php file before making any changes, as even a small file issue can disable your website from functioning. Next, open your wp-config.php file, locate the line that reads, “That’s all, stop editing! Happy publishing. */ or /* That’s all, stop editing! Happy blogging. */.” Then, copy and paste this code- 

define(‘ALLOW_UNFILTERED_UPLOADS’, true);

After that, save the file, and try uploading your media or document again. If that works, return to the wp-config.php file and remove this line.

Use the File Upload Types Plugin to Allow New File Types in WordPress

You can still upload file types that WordPress does not allow by adding them as supported file types. The simplest method to resolve the “Sorry, this file type is not permitted for security reasons” error is to use the File Upload Types plugin.

You should also use a custom entry if you see the error, This file was not uploaded. File type not allowed. ‘File type not allowed’ typically means that your MIME type doesn’t match the MIME type that WordPress is expecting to see.

Installing and turning on the File Upload Types plugin is the first step. After activation, navigate to the WordPress admin area’s Settings » File Upload Types page. Next, just enter the file type in the search field.

Then, select the check box next to the file type(s) you wish to enable. This will change the default upload settings for that file type. To save your changes, click the ‘Save Settings’ button at the bottom of the screen. After that, go back to the media library and add your file(s) without receiving an error message.

Allow New SVG File Types with WPCode

WPCode is the best WordPress code plugin that lets you insert code snippets into your website without directly editing your theme’s functions.php file. It has a code snippet specifically for allowing SVG file uploads. You can also manually specify which file types are allowed to be uploaded on your WordPress website. However, it can be dangerous to edit your site’s files because small mistakes can cause big WordPress errors.

Contact the support staff of your WordPress hosting provider and describe the situation if you’ve attempted all of the aforementioned fixes but are still receiving error messages.

WordPress defaults to less restrictive file-type restrictions than your provider probably does. Please get in touch with your provider’s customer service if the aforementioned methods are ineffective in fixing the “sorry, this file type is not permitted for security reasons” error.

By purchasing our WordPress plan at WpDepend, you can improve site speed while saving money and effort. This comprises WordPress security, WordPress backup, WordPress support, WordPress customization. Reach out to us today

svg%3E
Written ByDhruva Khanna

A seasoned technology writer and marketing consultant with over a decade of experience helping businesses grow online. I specialize in content marketing, SEO, web design, and e-commerce development. I am enthusiastic about using cutting-edge technology to acquire high-quality traffic, generate leads, and increase sales for my clients.