Cantech Knowledge Base

Your Go-To Hosting Resource

How to Fix Error in WordPress, “Sorry You are Not Allowed to Upload this File Type”?

WordPress has an inbuilt security filter, which blocks the specific file extensions. This will ensure that hackers do not upload harmful scripts to your server. But there may be occasions when you may be required to upload unique file formats to suit your business requirements.
There is a very simple trick that allows you to fix upload errors and add any type of file to your site. This article enables you to avoid the security limitations in your WordPress media library.

Meaning of File Upload Errors

The error message is shown because WordPress does not recognize the file extension that you are attempting to use. The system also only permits common formats by default to ensure the safety of the site.

  • Image Support: It is easy to upload common files as .jpg, .png, and .gif.
  • Document Support: The system can take common files such as .pdf, .docx, and .xlsx without any problems.
  • Media Support: Standard audio and video files, such as.mp3 and .mp4, work fine.

Impact of Changing Settings

You get more freedom by allowing any type of file, but the default security level is reduced. This method is only to be used when you are confident in the files that you are uploading.

  • Full Access: You are able to upload any extension, such as .svg or custom zip files.
  • Temporary Risk: Leaving this option permanently on may enable hackers to upload harmful files.

Steps to Allow All File Types

To remove the block, you have to add one line of code to your configuration file. Below are the steps that you can follow to update your site settings through the file manager.

Step 1: Locate wp-config.php

Open your hosting panel and enter the public_html folder. Find the file called wp-config.php in the main list.

Step 2: Edit the File

Right-click on the file and select the edit option. Keep scrolling until you come to the line about stopping the edit.

Step 3: Insert the Command

insert the code define(‘ALLOW_UNFILTERED_UPLOADS’, true); right above that line.

Step 4: Save and Upload

Click the save button in order to implement the new rules. You can now go to your media library and post what you want.

Cantech Security and Hosting

Cantech provides secure hosting settings that ensure that you are not affected by malicious uploads. Our servers scan all files so that your site stays healthy and fast.

  • Malware Protection: We scan all your uploads for viruses. This provides an added level of security even in cases where you allow any type of file.
  • Easy File Management: With our user-friendly file manager, it is very easy to edit your configuration files. There is no additional software required to go through these steps.

Conclusion

The “not allowed” error is simply a safety feature, which you can switch off when necessary. Always keep in mind to remove the additional code once you are done with your uploads, so that it is more secure. This makes your WordPress site flexible but secure against possible threats.

Frequently Asked Questions (FAQ’s)

1. Why does WordPress block some file types by default?

It prevents uploading of executable scripts that may be used to hack your site. This is a normal security precaution of every WordPress installation.

2. Is it possible to fix this with a plugin?

Yes, there are a number of plugins that enable you to add certain mime types. The code method is, however, quicker and does not slow down your site.

3. Is it proper to leave the code in the file?

After uploading, it is best to remove the line. This makes sure that the security filter will resume its operation for future uploads.

4. What if I still get an error after adding the code?

You may have to clear your browser cache or verify whether your host has any additional restrictions. The Cantech support team can help you solve such issues quickly.

November 18, 2026