Picture of Amir Vincent
Amir Vincent

Amir Vincent is a digital-marketing entrepreneur and the co-founder and CEO of Canada Create™, a Toronto-based agency specializing in SEO, web design, paid search, and social-media strategies for international clients

Need quick help? Let’s Talk About Your Growth

For a faster response, call (416) 273-9030. Otherwise, fill out the form below and our team will contact you.

This field is for validation purposes and should be left unchanged.
Select the Services(Required)

Ultimate Guide to Resolving the ‘Sorry, This File Type Is Not Permitted for Security Reasons’ Error in WordPress

fix-file-type-not-permitted-error-main

Trying to upload a file to your WordPress site but getting the "Sorry, this file type is not permitted for security reasons" error? Here's how to fix it.

If you encounter the message ‘Sorry, this file type is not permitted for security reasons’ in WordPress, it indicates that the platform is preventing you from uploading a file type that it does not recognize.

We’ve experienced this issue a few times and would like to share some effective solutions to help you overcome it.

You can upload the most common file formats in WordPress without encountering any issues. However, WordPress limits certain file types from being uploaded via your dashboard for security reasons, which can be frustrating if you need to upload a specific file for your site.

In this article, we will guide you through the steps to easily resolve the ‘Sorry, this file type is not permitted for security reasons’ error in WordPress.

What Triggers the ‘Sorry, This File Type Is Not Permitted for Security Reasons’ Error?

The error message ‘Sorry, this file type is not permitted for security reasons’ occurs when you attempt to upload a file type that is not supported by WordPress.

You may have encountered this error while trying to add a new file to your Media Library.

If you are using the latest version of WordPress, you might see the error message stating, ‘Sorry, you are not allowed to upload this file type.’

For security reasons, WordPress limits the types of files you can upload through your dashboard.

The allowed file types encompass all standard image, video, document, and audio formats.

One way to resolve this issue is by uploading files via FTP or using your WordPress hosting provider’s file manager. However, this method is less convenient than utilizing the built-in WordPress media library.

Let’s explore how to resolve the ‘Sorry, this file type is not permitted for security reasons’ error in WordPress. The methods outlined in this guide are beginner-friendly.

You can use the links below to navigate to the various solutions:

  • Option 1: Verify and Correct the File Type Extension Spelling
  • Option 2: Enable New File Types in WordPress Using the File Upload Types Plugin
  • Option 3: Enable New SVG File Types with WPCode
  • Option 4: Modify Your wp-config.php File (Advanced)

    Important Note:WordPress restricts many file types to protect your website from harmful files.

    When you allow additional file types, we highly recommend implementing security measures to safeguard your website. For more details, you can refer to our comprehensive guide on WordPress security.

    Option 1: Verify and Correct the File Type Extension Spelling

    You may have successfully uploaded the same file types to WordPress in the past, but this time your upload has failed, leaving you puzzled about the reason.

    This error might be occurring due to a typo in the file extension.

    A file extension is the three or four-letter suffix that appears at the end of file names on your device.

    For example, an image file could be named holidayphoto.png, where holidayphoto is the name of the file and png is the file extension.

    These extensions help various programs and applications, including WordPress, identify file types.

    Below are the default file types and extensions supported by WordPress:

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

    Pro Tip: While you can upload videos directly to WordPress, we recommend using a video hosting platform instead. This approach helps maintain your website’s speed and overall performance.

    For more insights, read our article discussing the reasons why uploading videos directly to WordPress is not advisable.

    When encountering this error, the first step we suggest is to verify the file extension to ensure it is accurate. It’s easy to accidentally remove or mistype a file name extension when editing or saving a file on your computer.

    If you’re using Windows, checking file extensions is straightforward. Open the folder containing your file, then click on the ‘View’ option at the top of the window. From there, simply check the box labeled ‘File name extensions’.

    Once you check that box, the file names will display their extensions.

    For Mac users, you can view file extensions by launching the Finder app and navigating to Finder » Settings or Preferences in the top menu.

    This will open the Settings popup. Click on the ‘Advanced’ tab and ensure that the box next to the ‘Show all filename extensions’ option is checked.Now that you can see the file name extensions, locate the file you attempted to upload and confirm it has the correct extension.Show all filename extensions’ option is checked.

    If the extension is incorrect, you can easily right-click on the file and select the ‘Rename’ option to modify the file name and add the appropriate extension.

    If the extension is incorrect, then you can simply right-click and select the ‘Rename’ option to change the file name and add the correct extension.

    Option 2: Enable Additional File Types in WordPress Using the File Upload Types Plugin

    If you wish to upload file types that WordPress doesn’t support by default, you can add them as accepted file types.

    The File Upload Types plugin is the simplest solution to resolve the ‘Sorry, this file type is not permitted for security reasons’ error. This plugin was developed in collaboration with Syed Balkhi, the founder of CanadaCreate.

    Start by installing and activating the File Upload Types plugin. For detailed instructions, refer to our comprehensive guide on installing a WordPress plugin.

    After activation, navigate to the Settings » File Upload Types section in your WordPress admin dashboard. Then, enter your desired file type into the search field.

    Next, check the box next to the file type(s) you wish to enable. This action will modify the default file upload settings.

    Be sure to click the ‘Save Settings’ button at the bottom of the page to apply your changes.

    Now, return to the media library.

    You will be able to upload your file(s) without encountering an error message.

    Option 3: Enable New SVG File Types Using WPCode

    You can manually define which file types are permitted for upload on your WordPress site. However, directly editing your site’s files can be risky, as even minor errors may lead to significant WordPress issues.

    For this reason, we recommend using WPCode. WPCode is an excellent WordPress code plugin that enables you to add code snippets to your site without the need to modify your theme’s functions.php file directly.

    WPCode includes a specific code snippet that allows SVG file uploads. For more details, refer to our guide on adding SVG image files in WordPress.

    Option 4: Modify Your wp-config.php File (Advanced)

    This approach is the most complex among those we’ve discussed, and we advise using it only if the previous methods have not succeeded in enabling the upload of your custom file types.

    We highly recommend backing up your WordPress site using a plugin such as Duplicator before proceeding with this tutorial to avoid potential errors.

    This method involves editing your wp-config.php file. For further details, please refer to our guide on how to edit your wp-config.php file in WordPress.

    After opening the file, locate the line that states /* That's all, stop editing! Happy publishing. */ or /* That's all, stop editing! Happy blogging. */Next, insert the following code directly above that line:

    define('ALLOW_UNFILTERED_UPLOADS', true);
    

    Once you save the file, attempt to upload your media or document again. If this works, return to the wp-config.php file and delete this line.

    This code allows users to upload file types that could potentially harm your site. Disabling these restrictions may expose your site to security risks such as malware uploads, so proceed with caution.

    Discover More Solutions for Common WordPress Errors

    Are you facing other issues on your WordPress site? Explore these guides to resolve the most frequent WordPress errors:

    • How to Resolve the 500 Internal Server Error in WordPress
    • How to Fix ‘The Site Is Experiencing Technical Difficulties’ in WordPress
    • How to Correct the Syntax Error in WordPress
    • How to Resolve the Error Establishing a Database Connection in WordPress
    • How to Fix the WordPress White Screen of Death (Step-by-Step Guide)
    • How to Resolve WordPress Posts Returning 404 Error (Step-by-Step Guide)
    • How to Fix the Sidebar Below Content Issue in WordPress

    We trust this guide has assisted you in resolving the ‘Sorry, this file type is not permitted for security reasons’ error in WordPress. Additionally, you might find our compilation of common issues with the WordPress block editor and our tutorial on fixing the 403 forbidden error in WordPress helpful.

    If you enjoyed this article, consider subscribing to our YouTube Channel for insightful WordPress video tutorials. You can also connect with us on Twitter and Facebook.

    Share This Post