Sorry, you are not allowed to upload this file type: how to fix it in WordPress
By Michael Broadbridge. Last checked 1 December 2026 on WordPress 7.1.5.
Short answer
WordPress shows "Sorry, you are not allowed to upload this file type." when the file’s extension is not on its allowed list, or the contents do not match the extension. Export the file again in an allowed format such as JPG, PNG, WebP or PDF. SVG is blocked by default and needs a plugin that cleans each file.
Symptoms
You may see one of these messages:
Sorry, you are not allowed to upload this file type.
Sorry, this file type is not supported here.
The server cannot process HEIC images. Convert it to JPEG before uploading.
The web server cannot generate responsive image sizes for this image. Convert it to JPEG or PNG before uploading.
- An upload to the Media Library stops with "Sorry, you are not allowed to upload this file type."
- In the block editor, the same message appears with the file name in front of it.
- JPG and PNG files upload normally, but an SVG, JSON, font or design file is refused.
- A file with a normal extension, such as .docx or .jpg, is refused while others like it are accepted.
- One site on a multisite network refuses a file that uploads on other WordPress sites.
Causes, most likely first
The file type is not on WordPress’s allowed list
WordPress only accepts extensions on a built-in list. SVG, JSON, XML, EPS, AI, TTF, WOFF and EPUB are not on it. Common image, audio, video, PDF, Office and zip types are.
The contents do not match the extension
WordPress checks what is inside the file as well as its name. If a file was renamed rather than exported, for example a PDF renamed to .docx, WordPress treats the mismatch as dangerous and refuses it.
The site runs an older version of WordPress
WebP uploads arrived in WordPress 5.8 and AVIF uploads in 6.5. An older version does not recognise the newer formats.
A multisite network limits file types
On a multisite network, the Upload file types setting decides what every site on the network can upload. The list is filled in when the network is set up, so a file type added to WordPress later may be missing from it.
Your user account is not allowed that type
HTML and JavaScript files are only accepted from users with the unfiltered_html capability. On a single site that means Administrators and Editors. On multisite it means Super Admins.
A plugin or custom code has changed the list
Plugins can add or remove file types with the upload_mimes filter. Security plugins and file type plugins can do this, and so can code in a theme.
How to fix it
Check the file itself
- Look at the file’s full name, including the extension. If your computer hides extensions, turn them on first.
- Open the file in the program that made it. If it will not open, or opens as something else, the file is damaged or has been renamed.
- Export it again with Save As or Export and choose the format you need. Changing the letters at the end of the name does not convert the file.
- Upload the new file.Menu:
Media > Add Media File - Test a plain JPG as well. If that fails too, the problem is wider than one file type.
WordPress corrects some images by itself. If a WebP image has been named .jpg, WordPress works out the real type and changes the file name, as long as the real type is allowed.
WebP, AVIF and HEIC images
All three are on the allowed list in WordPress 7.1, but the server also needs software that can process them. When it cannot, WordPress shows a different message that tells you to convert the image.
- Check the WordPress version and update if it is older than 5.8 for WebP, 6.5 for AVIF or 6.7 for HEIC. Take a backup first.Menu:
Dashboard > Updates - Open the Info tab, then the Media Handling section. Look for the format in the list of supported file formats.Menu:
Tools > Site Health - If the format is missing, ask your host whether the server’s ImageMagick or GD library can be updated to support it.
- Until then, convert the image to JPEG or PNG and upload that.
HEIC is the format iPhones use by default. Since WordPress 6.7, HEIC uploads are converted to JPEG on the server, but only if the server has a version of Imagick that supports HEIC.
SVG files
An SVG is a text file rather than a normal image, and it can contain scripts. A harmful SVG opened on your domain can run code in the browser of the person viewing it. WordPress leaves SVG off the allowed list, and adding it with a line of code does not clean the files.
- If you only need a logo or icon, export it as a PNG or WebP at twice the size it will be shown. This avoids the risk.
- If you need SVG, use a plugin that cleans each file on upload. Safe SVG by 10up does this, and it lets you choose which users can upload SVGs.
- Limit SVG uploads to people you trust, and only upload SVGs from a source you know.
- Upload the file again, then view the page to check it displays.
Cleaning has limits. The Safe SVG plugin page says it cannot guarantee every upload route is covered, because other plugins can add their own. Do not let visitors upload SVGs through a public form.
Multisite: check the network setting
- Log in as a Super Admin.
- Scroll to Upload Settings and find Upload file types.Menu:
Network Admin > Settings > Network Settings - Add the extension without a dot, with a space between each type, then save.
- Try the upload again on the site that refused it.
This setting cannot add a type WordPress does not know. WordPress’s documentation says a type outside the default set also needs the upload_mimes filter.
Allow another file type with the upload_mimes filter
This is for types such as JSON that WordPress does not accept. Only add a type you need. For SVG, use the steps above instead.
- Take a backup, and have SFTP or file manager access ready in case of a mistake in the code.
- In a small plugin or a child theme’s functions.php, add a function that takes the list, adds the extension and its MIME type, and returns the list. For example: $mimes['json'] = 'application/json';
- Attach the function with add_filter( 'upload_mimes', 'your_function_name' );
- Upload the file. If it is still refused, the type the server detects does not match the MIME type in your code. Some servers detect text-based files as text/plain. A developer can check this with the wp_check_filetype_and_ext filter.
- Remove the code when you no longer need that type.
Find a plugin or role problem
- Ask an Administrator to upload the same file. If it works for them, the limit is on your account.Menu:
Users > All Users - Check the settings of any security, upload or file type plugin for a list of allowed or blocked types.
- On a staging copy, deactivate those plugins one at a time and try the upload after each.
- If no plugin is responsible, search the theme’s functions.php for upload_mimes.
If that didn’t work
The message says the type is not supported here
"Sorry, this file type is not supported here." comes from the block, not the allowed list. It means that block does not take that kind of file, for example a PDF dropped into an Image block. Use a File block or upload it in the Media Library.
The message says you cannot upload files at all
"Sorry, you are not allowed to upload files." means your role does not have the upload_files capability. Contributors and Subscribers do not have it by default. An Administrator can change your role.
The message is about size or a failed security check
A file that is too large shows a different message, such as "The uploaded file exceeds the upload_max_filesize directive in php.ini." or "The link you followed has expired." Those need the PHP upload limits raised.
Why not to use ALLOW_UNFILTERED_UPLOADS
Some guides suggest adding define( 'ALLOW_UNFILTERED_UPLOADS', true ); to wp-config.php. No role has the unfiltered_upload capability by default, including Super Admins. With that line in place, users who have the capability skip the file type check for every kind of file, including PHP. Anyone who gets into such an account could then upload code to the server. If the line is already in wp-config.php, remove it.
When to get help
Stop if the fix would mean switching off the file type check for everything, if you find ALLOW_UNFILTERED_UPLOADS in wp-config.php and did not add it, or if ordinary JPG and PNG files are refused for every user.
What a developer would check
- The real type the server detects for the file, compared with its extension.
- Any plugin or theme code using upload_mimes, mime_types or wp_check_filetype_and_ext.
- Whether the PHP fileinfo extension and the Imagick or GD formats on the server cover the file.
- The wp-config.php constants, user roles and, on multisite, the network’s upload file types.
Describe the problem in your own words and WebFixed gives you an instant fixed quote. Nothing is charged until you accept it.
Related questions
- Is it safe to allow SVG uploads in WordPress?
- Only with care. SVG files can contain scripts, so use a plugin that cleans each file on upload, limit uploads to people you trust, and never accept SVGs from visitors. If a PNG or WebP would do, use that.
- Why does WordPress refuse a file that has an allowed extension?
- Because the contents do not match it. WordPress compares the detected type with the extension, and refuses the file if they disagree. Export the file again from the program that made it.
- Can WordPress accept iPhone HEIC photos?
- Yes, since WordPress 6.7 it converts HEIC uploads to JPEG when the server’s Imagick supports HEIC. If the server does not, convert the photo to JPEG before uploading.
Written by Michael Broadbridge, Founder of Webgro. First published 3 December 2026. Last checked 1 December 2026 on WordPress 7.1.5.