November 14, 2019
3min Read
Domantas G.
Did you try uploading a file to WordPress media library but ended up getting ‘Sorry, this file type is not permitted for security reasons’ error instead? Not to worry — this is a common error that you can solve in no time. In this article, we will uncover the cause of this error and how to fix it.
Table of Contents
By default, WordPress allows you to upload images, documents, media, and compressed archives in the majority of the popular file formats. Therefore, whenever you try to upload unsupported file types to the library, you will get the ‘Sorry, this file type is not permitted for security reasons’ error.
WordPress applies this restriction to protect its users from malicious files. Whether you upload them accidentally or purposefully, malicious files can affect your site negatively and expose its vulnerabilities to hackers.
If you still want to upload unsupported file types to your WordPress site, there are four methods of solving the ‘Sorry, this file type is not permitted for security reasons’ error. However, please note that this restriction is meant to protect you and, therefore, shouldn’t be taken lightly.
WordPress has plenty of Multipurpose Internet Mail Extensions (MIME) plugins that can help you add unsupported file types for upload. The following tutorial will show you how to fix the error using the WP Add Mime Types free plugin.
While you can edit the wp-config.php file to allow certain file types to enter the media library, this method will make your website less secure. Therefore, we advise you to revert any changes made once you have uploaded the unsupported file.
define(‘ALLOW_UNFILTERED_UPLOADS’, true);
If you don’t want to tinker with the wp-config.php file, you can modify your theme’s functions.php file instead. By using the upload_mimes filter, you get to alter WordPress’ behavior towards not permitted file types.
function my_custom_mime_types( $mimes ) { // Add new MIME types here $mimes['abiword'] = 'application/x-abiword'; return $mimes; } add_filter( 'upload_mimes', 'my_custom_mime_types' );
In some cases, your hosting provider restricts certain file types to ensure security. If that’s the case, you can contact them to get the best solution to solve this error. If you’re a Hostinger client, feel free to contact our customer success team via live chat, and they will gladly assist you with this matter.
The ‘Sorry, this file type is not permitted for security reasons’ error is WordPress’ precautionary measure against malicious files. While it’s not encouraged, there are several methods of solving this issue and allowing your WordPress site to accept unsupported MIME types.
Do you find this tutorial helpful? Let us know in the comments section below!
July 10 2017
If you use the Wordpress plugin "WP Add Mime Types", please set the value below. abw = application/x-abiword The left value is a file extension value.
November 13 2017
As per this thread on the WordPress forums, the 'Allow unfiltered uploads' is a horrible idea because it creates a huge security problem. Just so you know.
March 11 2020
Hi Good evening: Ihave this issue but only when i upload a file using the Block editor in WP 5.3.2. Instead, if I upload via media library Idont have issues. Could you give me an idea to fix my problem? Thanks you very much Regards from Mexico
emmayoung
Replied on March 12 2020
Hi Alberto, Have you tried disabling your plugins to see if the issue is there? Possibly the Enhanced Media Library plugin? If so, you can try installing the classic editor plugin to rollback to the previous editor (https://wordpress.org/plugins/classic-editor/) Good Luck! :)