Are you trying to upload a file in your WordPress media library and getting the error “Sorry, this file type is not permitted for security reasons”?

This is because WordPress allow its users to upload very common media files. for security purpose. 

However, you upload a new file type it prompts you an error that this file type is not supported by WordPress. 

You can resolve it manually or by plugins. 

So, In this article, I Will show you how to fix the “Sorry, this file type is not permitted for security reasons” error in 5 minutes.

What Prompts the “Sorry, This File Type Is Not Permitted for Security Reasons” Error?

However, you are trying to upload unsupported files to

WordPress media library, For security reasons It doesn’t, allows you to do it and clicks the error “Sorry, This File Type Is Not Permitted for Security Reasons” 

There are some common file types allowed in the WordPress library as below. 

  • Images: jpg, jpeg, png, gif, .ico
  • Videos: .mp4, .m4v, .mov, .wmv, .avi, .mpg, .ogv, .3gp, .3g2
  • Documents: .pdf, .doc, .ppt, .pptx, .pps, .ppsx, .odt, .xls, .xlsx, .psd
  • Audio: .mp3, .m4a, .ogg, .wav

So, these are the common file extension which allows by WordPress by default. If you need an additional file extension to upload you need some additional permission. 

For example, If you want to use custom fonts on your WordPress site. You need to upload a custom font file which is .tff format, but such a file format is not allowed in WordPress to upload. If you try to upload it you will get the error instead of normally uploading.

How to Fix “Sorry, this file type is not permitted for security reasons” error in 5 Minutes

There are two methods to fix the “Sorry, this file type is not permitted for security reasons” error in WordPress

By Free WordPress Plugin 

If you are looking for an easy way to do it then you can do it by installing a Free WordPress plugin.

In this method, you have the right control over your allowed file types. 

To do this you can use a free WordPress plugin named “WP Extra File Types

You can download it through directly from your plugin section or WordPress.org. 

After installing this plugin, you can find it on your admin dashboard’s setting section. 

Go to Setting and click on the Extra File Types option.

You can see a long list of file types along with a checkbox.

You have to just check the box of file type you required and then save changes. 

That’s it, It will enable allows you to upload the file type which you selected.

If you are unable to find the required file types in the list you can also set your custom file type to upload it. 

By Adding Permission to wp-config.php

WordPress CMS has the “ALLOW_UNFILTERED_UPLOADS” option in the “wp_config.php” file. By enabling it you can upload any types of files to the WordPress media library. 

So before editing the “wp_config.php” file, it is highly recommended to take a backup of the file.

To get started you can use your hosting provided file manager or connect your WordPress site via FTP.

After connecting your site go to the root directory of your website. The root directory is the same folder where wp-includes and wp-admin folder located. 

Right-click on the “wp_config.php” file and download it to your local computer.

After download it opens it via notepad and adds the following code above the “/* That’s all, stop editing! Happy blogging. */” line.

define (‘ALLOW_UNFILTERED_UPLOADS’, true);

That’s it, Make sure you save all the changes by pressing “ctrl+s.”

After saving upload again this file to the root directory of your WordPress Website. 

Now log out and log in to your admin dashboard. 

Try to upload any uncommon file to your WordPress media library. 

It will be upload successfully.

Recommended Theme: Free Download EXTRA THEME LATEST GPL VERSION {ORIGINAL}

Summary

For security reasons, WordPress CMS has limitations to upload some common file types in the WordPress media library.

If we try to upload any new file type to the media library, you can prompt with “Sorry, this file type is not permitted for security reasons” error.

There is two way to fix this problem, one is by using third party free WordPress plugin and second is editing the wp-config.php file.

The first method is quite simple by just installing a free plugin and enabling the file type which you want to upload.

In this case, you have control of all files which you want to upload. Here you can also choose a custom file type to upload.

In the second method, you need to add the code ALLOW_UNFILTERED_UPLOADS to the  wp-config.php file.

You can edit this file from your WordPress site root directory.

But after putting this code, there is no control on file type upload. 

You can upload any file type to the media library without any error. 

If you found this tutorial helpful share with your friends and still facing error? Let us know in the comment section.

You can follow us on Facebook for future updates and tutorials.

Write A Comment