fbpx
Search
Close this search box.

How to fix “Sorry This File Type Is Not Permitted for Security Reasons” Error in WordPress

Table of Contents

Get up to 50% off now

Become a partner with CyberPanel and gain access to an incredible offer of up to 50% off on CyberPanel add-ons. Plus, as a partner, you’ll also benefit from comprehensive marketing support and a whole lot more. Join us on this journey today!

You’re not able to upload a file to WordPress website because you received an error message that says, “Sorry this file type is not permitted for security reasons.”

Don’t panic; while this message may appear alarming, it only indicates that the file type you attempted to upload is not supported by WordPress. We’ll look at what causes this error message and a few free and simple solutions to fix it in this post.

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

When you try to upload a file type that WordPress doesn’t support, the error “Sorry, this file type is not permitted for security reasons” displays.

This error notice may have appeared when you attempted to add a new file to your Media Library.

WordPress limits the file formats you can upload through your WordPress admin for security reasons.

All commonly used picture, video, document, and audio file formats are allowed.

Tech Delivered to Your Inbox!

Get exclusive access to all things tech-savvy, and be the first to receive 

the latest updates directly in your inbox.

File types allowed in WordPress

WordPress can handle a wide range of media kinds, including photos, videos, documents, and audio files. Multipurpose Internet Mail Extensions, or MIME types, are another name for these file types. Browsers use MIME types to determine what type of content has been posted to a web page.

If you are attempting to upload a common file type that you have previously submitted without seeing this problem, the file extension is most likely misspell.

The 3 or 4 letter filetype suffix that displays at the end of file names on your computer is known as a file extension. For example, a picture file might be called picture.png, with “picture” as the file name and png as the extension.

The following file types are supported by WordPress:

Images

• .jpg
• .jpeg
• .png
• .gif
• .ico

Document

• .pdf
• .doc, .docx
• .ppt, .pptx, .pps, .ppsx
• .odt
• .xls, .xlsx
• .psd

Audio

• .mp3
• .m4a
• .ogg
• .wav

Enhance Your CyerPanel Experience Today!
Discover a world of enhanced features and show your support for our ongoing development with CyberPanel add-ons. Elevate your experience today!

Video

• .mp4, .m4v
• .mov
• .wmv
• .avi
• .mpg
• .ogv
• .3gp
• .3g2

These are all very frequent file types. You may, however, want to use a file type that isn’t on this list. Alternatively, you may be attempting to upload one of these approved file formats but receiving the error message “unfortunately, this file type is not permitted for security reasons.”

In either instance, you can take actions to avoid receiving this error message.

How to Fix the “Sorry This File Type Is Not Permitted for Security Reasons” Error?

In this article we will be talking about 5 ways in which you can avoid “Sorry This File Type Is Not Permitted for Security Reasons” Error message.

  1. Check the extension of the file you’re working with.
  2. Using a Plugin, Change Approved File Types
  3. Add New Permitted File Types Using wp-config.php
  4. Edit your theme’s function.php file to modify permitted file type:
  5. Use the Free WP Extra File Types plugin:

Now lets look at each of these methods in complete detail.

1. Check the extension of the file you’re working with:

Check the extension of the file you’re trying to upload before making any changes to your WordPress settings or files. It’s possible that when you saved the file, you altered the extension by accident. So, the error message you’re getting isn’t due to a problem with your wp-config.php or functions.php files; it’s because you’re attempting to upload a video picture.

2. Using a Plugin, Change Approved File Types:

File Manager and Enhanced Media Library, for example, are two plugins that allow you to upload banned file types. These plugins include options for adding allowed Multipurpose Internet Mail Extensions (MIME) types for uploading to WordPress.

To add new authorized MIME types for upload, we’ll utilize the Enhanced Media Library plugin.

  • Go to your site’s dashboard
Sorry, This File Type Is Not Permitted for Security Reasons
  • Plugin → Add new, from the left hand-side menu
  • Search for “Enhanced Media Library”
  • Install and Activate
  • Settings → Media → MIME types, from the left hand-side menu
sorry this file type is not permitted for security reasons
  • Allowing uploads for a specified MIME type can be done in 2 ways:
    • Simply check the box in the “Allow Upload Column”that correspnds to the chosen MIME type
    • If your chosen type is not available, you will have to go to the top of the page and click “Add New MIME type”
  • This will create a new row for you to fill out with the extension, MIME type and labels/ Then, for the new MIME type, check the “Allow Upload” Box. If you change your mind, you can delete entries using the button at the bottom of each row or select “Restore WordPress default MIME” Type to revert to the default settings.

3. Add New Permitted File Types Using wp-config.php:

ALLOW_UNFILTERED_UPLOADS is a WordPress option that you can enable in your site’s wp-config.php file. You’ll be able to upload any file type to your WordPress Media Library once it’s enabled.

The wp-config.php file for your site is in the root folder, which also contains the wp-admin and wp-includes folders.

  • Go to site’s dashboard
  • plugin → Add new, from the left hand-side menu
  • Search for “File Manager” plugin
  • Install and Activate
  • “File Manager” will provide you to edit , delete, upload, download, copy and paste files and folders.
  • “File Manager” tab will appear in the left hand-side menu. Click on that
  • Click on “WP File Manager”
  • Public_html → wp-config.php right click on it and click on code editor
  • Add the following code snippet

define ('Allow_unfiltered_uploads',true);

  • Make sure to save your changes.

4. Edit your theme’s function.php file to modify permitted file type:

The Upload Mimes Filter can be used to enable just specified file types to be uploaded to your site.

  • Go to site’s dashboard
  • Plugin → Add new, from the left hand-side menu
  • Search for “File Manager” plugin
  • Install and Activate
  • “File Manager” will provide you to edit , delete, upload, download, copy and paste files and folders.
  • “File Manager” tab will appear in the left hand-side menu. Click on that
  • Click on “WP File Manager”
  • Open your wp-content folder
  • Open themes folder
  • Locate and click functions.php , select “Edit”
  • Scroll to the bottom and paste the following code

function cc_mime_types($mimes) {

// New allowed mime types.

 $mimes['svg'] = 'image/svg+xml';

 $mimes['svgz'] = 'image/svg+xml';

return $mimes;

}

add_filter( 'upload_mimes', 'my_custom_mime_types' );

  • Click save

It’s worth noting that the code above supports both SVG and SVGZ files. Depending on the file types you want to upload, you can edit or add MIME types to this code snippet.

Beginners may have difficulty adding code to their functions.php or wp-config.php files, but advanced users will not.

5. Use the Free WP Extra File Types plugin:

You can utilize the free “WP Extra File Types” plugin if you don’t want to alter your wp-config.php file and/or want more control over which file types can be uploaded to your site.

  • Go to your site’s dashboard
  • Plugin → Add new, from the left hand-side menu
  • Search for “Extra File Type” plugin
  • Install and activate
  • Settings → Extra file type , from the left hand-side menu
  • There is a long list of file types, Check the boxes next to the file types you want to be able to upload, then save your changes at the bottom
  • If the file type you want to upload is not on the list, you can create your own custom file types at the bottom of the plugin’s settings page
  • Click on save changes.

Conclusion:

When making modifications to your site, WordPress problems can cause delays. When it comes to the Sorry, this file type is not permitted for security reasons problem, however, there are a few options for allowing you to upload files that WordPress does not permit by default.

We’ve spoken over what causes this problem in WordPress and why it exists in this article. Then we gave you five options for resolving the problem.

Editorial Team

Unlock Benefits

Become a Community Member

SIMPLIFY SETUP, MAXIMIZE EFFICIENCY!
Setting up CyberPanel is a breeze. We’ll handle the installation so you can concentrate on your website. Start now for a secure, stable, and blazing-fast performance!