Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

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

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Are you seeing the ‘Sorry, this file type is not permitted for security reasons’ error in WordPress?

You can upload most common file types in WordPress without any errors. However, you may see this error if the file type is not supported by WordPress.

In this article, we will show you how to easily fix the ‘Sorry, this file type is not permitted for security reasons’ error in WordPress.

Fixing the File type is not permitted for security reasons error in WordPress

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

The error “Sorry, this file type is not permitted for security reasons” appears when you try to upload a file type that WordPress does not support.

You may have seen this error message appear when trying to add a new file to your Media Library.

Uploading a file in Media Library that shows the file not permitted security message

If you use the latest WordPress version, you may see the error message saying, “Sorry, you are not allowed to upload this file type.”

For security reasons, WordPress restricts the file types you can upload through your WordPress dashboard.

Sorry you are not allowed to upload this file type error

The permitted file types include all common images, video, document, and audio formats.

One solution to fix this problem is to upload the files through FTP or your WordPress hosting provider’s file manager app. However, it is not as convenient as using the built-in WordPress media library.

So, let’s take a look at how to fix the “Sorry, this file type is not permitted for security reasons” error in WordPress. The methods explained in this guide are all friendly for beginners.

You can use the links below to jump to the different solutions:

Option 1: Check and Fix the File Type Extension Spelling

Let’s say that you might have uploaded the same types of files to WordPress previously with success. However, this time, your attempt has failed, and you are wondering why that is.

In this case, it is likely that the error occurs because you have misspelled the file extension.

A file extension is the 3 or 4-letter file type suffix that appears at the end of file names on your computer.

For instance, an image file may be named holidayphoto.png, where holidayphoto is the file name and png is the extension.

These extensions are used by many programs and applications, including WordPress, to recognize file types.

Here are the default WordPress file types and extensions:

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: Although you can upload videos to WordPress, we always recommend uploading your videos to a video hosting site instead. This helps protect your website’s speed and performance.

You can read more on this in our opinion piece about why you should never upload a video to WordPress.

When you get this error, the first thing we recommend is checking the file extension to make sure it is correct. Sometimes, you may accidentally delete a file name extension or mistype it while editing or saving a file on your computer.

On Windows 10 and 11, you can easily check file extensions. Simply open the folder that contains your file and click on the ‘View’ link at the top of the window. From here, simply check the ‘File name extensions’ box.

Setting file extensions to display after your filenames

After checking that box, you will now see the extension after the file names.

In the example below, you can see that it is a JPG image.

The file extension is now displaying

This will show the extension for all files on your computer, not just the ones in this folder.

Mac users can view file extensions by opening the Finder app and going to Finder » Settings or Finder » Preferences in the top menu.

Show file extension on Mac

This will bring up the Preferences popup, where you need to click on the ‘Advanced’ tab and make sure that the box next to the Show all filename extensions’ option is checked.

Now that you can view the file name extensions, find the file you were trying to upload and make sure it has the correct 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: Allow New File Types in WordPress With the File Upload Types Plugin

If you want to upload file types that are not supported by WordPress, then you can still upload them by adding them as a supported file type.

The File Upload Types plugin is the easiest way to fix the “Sorry, this file type is not permitted for security reasons” error. This plugin was co-created by WPBeginner’s founder, Syed Balkhi.

First, you need to install and activate the File Upload Types plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, go to the Settings » File Upload Types page in your WordPress admin area. Then, simply type your file type into the search box.

Search for the file type you want to enable

Next, check the box next to the file type(s) that you want to enable. This will change the default file type upload settings.

You must then click on the ‘Save Settings’ button at the bottom of the screen to store your changes.

Enabling your chosen file type in File Upload Types

Now, go ahead and return to the media library.

You will be able to add your file(s) without getting an error message.

Successfully uploading your file without getting a security error message

Option 3: Allow New SVG File Types Using WPCode

You can also manually specify which file types are allowed to be uploaded on your WordPress website. However, it can be dangerous to edit your site’s files directly because small mistakes can cause big WordPress errors.

That’s why we recommend using WPCode instead. WPCode is the best WordPress code plugin that allows you to insert code snippets into your website without directly editing your theme’s functions.php file.

WPCode has a code snippet specifically for allowing SVG file uploads. You can see more in our guide on how to add SVG image files in WordPress.

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

This method is the most advanced of all the ones we’ve listed, and we only recommend it if none of the above options have worked to upload your custom file types.

We also strongly suggest backing up your WordPress website using a plugin like Duplicator before following this tutorial to prevent further errors.

This method requires editing your wp-config.php file. For more information, you can check out our guide on how to edit your wp-config.php file in WordPress.

Once you open the file, find the line that says /* That's all, stop editing! Happy publishing. */ or /* That's all, stop editing! Happy blogging. */ . Then, copy and paste the following code right above that line:

define('ALLOW_UNFILTERED_UPLOADS', true);

After that, save the file and try uploading your media or document again. If this method is successful, then go back to the wp-config.php file and remove this line.

This code prevents users from uploading file formats that could harm your site. By disabling these filters, you’re opening your site to potential security vulnerabilities like malware uploads, so you should use this method with caution.

Keeping Your WordPress Site Secure When Permitting Additional File Types

The reason WordPress blocks many file types is to help keep your WordPress website secure.

When you enable additional file types, we strongly advise taking some security measures to protect your WordPress website.

You should:

We hope this article helped you learn how to fix the “Sorry, this file type is not permitted for security reasons” error in WordPress. You may also want to see our list of must-have WordPress plugins for your website and our ultimate guide on how to fix the most common WordPress errors.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

7 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Mrteesurez says

    Thanks but to clear the doubt.
    Meaning File upload plugin is sufficient for me to upload SVG too or Do is till need to use code to make it work ?

  3. Gabriel says

    I want to upload a .epub file. I installed the plugin, checked the “.epub” box, and I’m still getting the error.

    • WPBeginner Support says

      If the plugin is having issues, please reach out to the support on the plugin’s page for them to take a look and assist with any specific issues with your site.

      Admin

  4. Annette says

    Hi, I got this error when trying first time to upload an m4a-file, so I converted the file to mp3 and it could be uploaded. I uploaded two more mp3’s. Next time I logged in and tried to upload an mp3-file, I got that error as well. I can see in this turorial that even m4a should have been accepted. I checked the spelling, even eliminated spaces from the filename. What else could be wrong?

    Thanks for a good tutorial series, yours are often the most valuable answers when I need to search around.

    • WPBeginner Support says

      You would likely need to check with your host to ensure this isn’t a limitation that was set on their end.

      Admin

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.