Wednesday, May 25, 2022

Fixed “sorry, this file type is not permitted for security reasons” error in WordPress

If you are uploading a file on WordPress and you see the error “sorry, this file type is not permitted for security reasons” then it is because of the unknown format or unsupported file.

WordPress allow us to upload the most common format for image, video, audio and documents. known format for wordpress are below.

Image: Png, jpeg, jpg, gif, and ico
Video: mp4, mpg, mov, m4v,  ogv, 3gp, 3g2, wmv, and avi
Documents: pdf, psd, doc, docx, ppt, pptx, xls, xlsx, pps, ppsx, and odt
Audio: mp3, m4a, ogg and wav

If your file format is deferent from these formats then you will see the error “sorry, this file type is not permitted for security reasons” on WordPress.

sorry, this file type is not permitted for security reasons

If you are also facing this problem then you can find the solution in in article. By editing the function.php file and with the help of plugin we can easily upload any type of file on WordPress.


“sorry, this file type is not permitted for security reasons” error causes

This error is common when you try to upload the unsupported files format in media library from the admin dashboard.

1st Reason: It may cause of unsupported files which are not allowed by WordPress by default. Supported files you can check above.

2nd Reason: May be you are trying to upload the correct format but the file type extension spelling is wrong. Misspelled the file extension is common mistake.

For example: indoclan-logo.png is one file here indoclan-logo is the name of the file and .png is the extension.

May be the extensions of the files are not visible on your computer. So you can read “How to check file extension in windows and Mac.

If you are getting the error and it wasn’t happen with same format before then it is cause of the misspelled file extension.

Read: Upload SVG in WordPress Website

How to fix “sorry, this file type is not permitted for security reasons” error

As we mentioned above that there are two solutions are available to fix “sorry, this file type is not permitted for security reasons” error in WordPress.

    1. With the help of plugins
    2. By editing the function.php file

⇒Fix error with the help of plugins

Multiple plugins are available to allow the extra or deferent file types in WordPress. But we explained about the two best plugins.

1.WP Extra File Types

Wp extra file types plugin is the best for those who are not comfortable to edit the function.php file. Or if you are not from the technical background then it is not recommended to edit the function.php file.

Install and activate ‘Wp extra file type’ plugin and follow the instructions below.

Go to Setting > Extra File Type

Now, you can see the list of file types. Select the file type which you want to upload in WordPress.

By click on the check box you can select the file type, this plugin allow us to select multiple file types. Don’t forget to click on ‘Save Changes’ button.

If you didn’t find the file format in this list which your want to upload then you can can add your own custom file type with the help of Wp Extra File Types plugin.

2.File Upload Types by WPForms

File Upload Types by WPForms

This plugin is the alternative of wp extra file types plugin. Install and activate the plugin and go to Settings > File Upload Types

Once you click this File Upload Types, you can see the search bar to search the file extension.

Find the check box next to the file type, check that box and click on ‘Save Settings

Go to media and upload the file in your WordPress without “sorry, this file type is not permitted for security reasons” error.

⇒Allow new file type by editing the function.php

WordPress have the ALLOW_UNFILTERED_UPLOADS option in function.php file. Once you activate this then you can upload any type of file in WordPress.

function.php file you can find in your website’s root folder. For more info check our guide on  how to edit function.php file.

When you edit the function.php file find the

define('ALLOW_UNFILTERED_UPLOADS', false);

You just need to change the false to true and save the file.

But, if this code snippet is not available in the function.php then copy define('ALLOW_UNFILTERED_UPLOADS', true); and paste in your function.php file.

Note: Paste or add this code snippet before ‘/* That’s all, stop editing! Happy blogging. */’ line and save the file.

Sharing is Caring

Don't forget to share with others. Thanks! 

My Name is Rashvinder Narwal, I am in Website design and development profession from 2015. I love to share my knowledge with my readers over 15+ blogs in English and Hindi language. Thanks !

LEAVE A REPLY

Please enter your comment!
Please enter your name here