Sorry This File Type Is Not Permitted for Security Reasons WordPress: Here’s How To Fix It

Two people handling files marked with an upload warning

Running into the Sorry, this file type is not permitted for security reasons WordPress message can feel like hitting a brick wall, particularly when you’re about to upload new images or documents.

WordPress has put these restrictions in place to protect your site from potential security risks. While these safety measures are important, they can sometimes stop you from uploading files you trust are safe.

The good news is that there’s an easy fix. With a few adjustments, you’ll be back to updating your site without any hassle.

TL;DR

The “Sorry, this file type is not permitted for security reasons” error in WordPress blocks unsupported file types to protect your site from security issues. Always use safe methods like file conversion to avoid this error. If you choose riskier options like editing core files, ensure you back up your site first.

What does the error message mean?

WordPress message saying the selected file type is not permitted for security reasons

When you see the “Sorry, this file type is not permitted for security reasons” error, it’s WordPress’s way of keeping your site secure. WordPress blocks certain file types because they could carry viruses or malware.

This error typically appears when you try to upload less common file types, like SVGs, or others that are not on WordPress’s approved format list. WordPress allows well-known file types like PDFs, PNGs, and JPEGs—files it considers safe. Blocking unfamiliar types prevents harmful scripts from entering your site, ensuring smooth operation.

WordPress might block your file if it doesn’t recognize its type, even if the file seems safe to you. This error, while annoying, is WordPress making sure your site remains secure and functions well.

How to fix the sorry this file type is not permitted for security reasons WordPress error

Getting this error message can be annoying, but there are easy ways to fix it. Let’s go through the options:

This method is recommended because it keeps your site secure without making risky changes. By sticking to file types that WordPress already trusts, you avoid potential headaches and maintain a safe website.

  • Find out what’s allowed: Check which file types WordPress lets you upload. Common ones include JPEG, PNG, and PDF.
Online file format converter with source and output format controls
  • Change your file format: Use an online tool or software to convert your file to one of these accepted formats. There are many free options available.

  • Try uploading again: Upload the new file to your site. This method is safe and keeps everything running smoothly.

B) Edit wp-config.php file

This method is considered risky because it involves changing the core files of your WordPress site. Making a mistake here can lead to site crashes, bugs, or other technical issues.

Important tip: Always take a backup of your site before editing any core files. This way, you can restore your site to its previous state if something goes wrong. Taking a backup is like having a safety net to protect your work, ensuring you’re prepared for any mishaps.

  • Access your files: Use a tool like FTP or your hosting panel to get into your WordPress files.
wp-config.php file selected in the Cyberduck file browser
  • Open the file: Find the file called wp-config.php and open it with a text editor.

  • Add the code: Type in the following line of code within your wp-config.php file:

PHPPHP
define('ALLOW_UNFILTERED_UPLOADS', true);

This allows more file types through.

  • Save and close: Save your changes and upload the file back. Be careful, as this can mess with your site if done incorrectly.

C) Use a plugin

Using a plugin to allow additional file types can be a quick solution, but it comes with its own set of risks. Plugins can sometimes conflict with other components of your site, leading to unexpected issues or even site crashes.

Additionally, relying on third-party plugins can introduce security vulnerabilities if the plugin is not well-maintained.

  • Find and add plugin: Look for a plugin like WP Extra File Types in the WordPress plugin repository. Or you can head to the Plugins in your WordPress dashboard, click Add New, search for the plugin, install and activate it.
WordPress plugin search results for WP Extra File Types
  • Set it up: Head to Settings > Extra File Types and check the boxes for the file types you want to allow. Next, save your changes.
Add more file formats

D) Consult with Hosting Provider

If you’re not sure about making these changes, contact your hosting provider’s support team.

They might have easy solutions specific to your hosting setup, making this a safer choice if you’re not tech-savvy.

What to do when you still get an error on file formats supported by WordPress

What to do when you still get an error on file formats supported by WordPress

Sometimes, you might get an error even when you’re uploading a file type that WordPress usually accepts. This can be really annoying, but there are some steps you can take to fix it.

Check for plugin conflicts:

Errors often happen because of bugs in plugins, especially those related to images. If you recently added a new plugin, try disabling it and see if that helps.

Go through your plugins one by one, turning them off and then trying your upload again to find out which one is causing the problem. Once you find the troublemaker, contact the plugin developer for further assistance.

Try a different theme:

WordPress Themes screen with a default theme ready to activate

If disabling plugins doesn’t work, your theme might be the issue. Switch to a default WordPress theme and see if the error goes away. Sometimes themes can mess things up without you even knowing it.

Reinstall WordPress core files:

If changing themes doesn’t help, try repairing your WordPress installation. This can fix any hidden issues with the main part of your site.

Get help from your hosting provider:

If none of these steps work, it might be time to reach out to your hosting provider. They can offer more advanced help and figure out if there’s a bigger problem.

Best practices to prevent the issue from recurring

To keep your site running smoothly and avoid these headaches in the future, follow these best practices:

Keep everything updated: Regularly update WordPress, your themes, and plugins. This helps prevent bugs and keep your site secure.

MalCare Safe Updates screen with update and restore-point controls

Choose wisely: Use only trusted plugins and themes from reputable sources. Check reviews and ensure they’re compatible with your WordPress version before installing.

Limit plugins: The more plugins you have, the more chances for conflicts. Keep only the ones you really need.

Backup regularly: Make sure to backup your site often using a reliable backup plugin. This way, if something goes wrong, you can easily restore your site to a working state.

BlogVault backup details with restore and download controls

Avoid direct changes: Try not to make direct changes to the core WordPress files, as this can cause issues down the line.

Keep a record: Note down any changes or updates you make to your site. This helps you track what might have caused issues if they arise.

Parting thoughts

If you’re having trouble uploading files to WordPress, try changing the file to a safer format first. It’s the easiest way to avoid problems.

If you need to use trickier methods, like plugins or editing files, be extra careful and undo those changes once the problem is fixed.

Always keep your WordPress site updated and back it up regularly. If you’re stuck, ask your hosting support for help. These steps will help keep your site safe and running well.

FAQs

Why does WordPress say “sorry you are not allowed to upload this file type”?

This message appears because WordPress restricts certain file types to protect your site from potentially harmful files. It’s a security measure to ensure only safe file types are uploaded.

How do I allow file types in WordPress?

You can allow additional file types by using a plugin like WP Extra File Types or by editing the wp-config.php file to enable unfiltered uploads. However, proceed with caution and consider the security risks.

Which file type is not accepted in WordPress by default?

WordPress does not accept certain file types by default, such as SVGs, EXE, and certain script files, because they can contain code that might be harmful to your site.

What to do when a file type is not allowed?

Convert the file to a supported format like JPEG, PNG, or PDF. Alternatively, you can adjust settings using a plugin or by editing core files, but always back up your site first.

How do I fix file permissions in WordPress?

Fixing file permissions involves accessing your site files via FTP or your hosting control panel and setting the correct permissions for files and directories, often to 644 for files and 755 for directories, to ensure proper functionality and security.

Shivani enjoys crafting guides that make every aspect of using WordPress simple and easy to follow. When she's not glued to her laptop, you can find her buried in a good book or occasionally, painting.