Fix “Sorry, this file type is not permitted for security reasons” error in WordPress (2024)

All help articles

Updated on January 25th, 2024

Sometimes when you try to upload a file to WordPress, you’ll see this error: “Sorry, this file type is not permitted for security reasons.” Or if you’re using the latest version of WordPress, the error message may say, “Sorry, you are not allowed to upload this file type.”

This usually occurs because the file’s MIME type (also called “Media type”) is restricted from upload due to default WordPress settings.

Luckily, there are several ways to authorize additional file types for upload.

Table of Contents:

  • MIME types explained
  • Plugin method to authorize uploads for additional MIME types
  • Functions.php method to authorize uploads for additional MIME types
  • Allow unfiltered uploads via wp-config.php
  • Configure multisite upload settings

MIME types explained

MIME stands for Multipurpose Internet Mail Extensions. MIME types are used by browsers and other internet devices to determine the type of content associated with a page.

For instance, if you have a .png file and a .jpeg file on a page, the browser would know by their MIME types (not their file extension) to treat both files as images, rather than videos or other file types.

By default, WordPress stores a list of registered MIME types in wp-includes/functions.php. However, not all MIME types recognized are allowed to be uploaded in the WordPress admin dashboard.

File types supported by default

Images.jpg
.jpeg
.png
.gif
.ico
Documents.pdf (Portable Document Format; Adobe Acrobat)
.doc, .docx (Microsoft Word Document)
.ppt, .pptx, .pps, .ppsx (Microsoft PowerPoint Presentation)
.odt (OpenDocument Text Document)
.xls, .xlsx (Microsoft Excel Document)
.psd (Adobe Photoshop Document)
Audio.mp3
.m4a
.ogg
.wav
Video.mp4, .m4v (MPEG-4)
.mov (QuickTime)
.wmv (Windows Media Video)
.avi
.mpg
.ogv (Ogg)
.3gp (3GPP)
.3g2 (3GPP2)

To allow uploading of file types not listed above, there are a few ways to get around the restrictions.

Authorize uploads for additional MIME types using a plugin

We recommend WP Extra File Types. Setup is really simple, just click the file types you want to allow and save your changes.Fix “Sorry, this file type is not permitted for security reasons” error in WordPress (2)

Other plugin options include:

Authorize uploads for additional MIME types via functions.php

If you’re code-savvy, you can add the requirements to the active theme’s functions.php file. The example below can be modified for the file types you want to allow:

function my_theme_custom_upload_mimes( $existing_mimes ) { // Add webm to the list of mime types. $existing_mimes['webm'] = 'video/webm';// Return the array back to the function with our added mime type.return $existing_mimes;}add_filter( 'upload_mimes', 'my_theme_custom_upload_mimes' );

Allow unfiltered uploads via wp-config.php

All uploads can be authorized with the addition of the following line to the site’s wp-config.php file:

define('ALLOW_UNFILTERED_UPLOADS', true);

It’s important to note that this allows all file types to be uploaded by administrator-level users. It’s best practice to add file types as needed.

Configure multisite upload settings

If you are developing a multisite, you can edit MIME types directly from the multisite settings, no plugins or coding required!

  1. From the WordPress admin area, navigate to Network Admin > Settings > Network Settings
  2. Scroll down to Upload Settings and add or remove file types from the Upload file types field.

Need help?

If you have any questions our Happiness Engineers are here to help!

Was this article helpful?

Getting Started

New to Flywheel? Start here, we've got all the information you'll need to get started and launch your firstsite!

  • Migrate your site to Flywheel using Flywheel Migrations
  • Go live on Flywheel
  • Demo sites on Flywheel

View all

Account Management

Learn all about managing your Flywheel user account, Teams andintegrations.

  • Collaborators in Flywheel
  • Transfer subscriptions between your account and your organization

View all

Billing

Everything about billing, invoices and payments can be foundhere.

  • Overage pricing
  • Transfer billing to my client

View all

Features

Flywheel hosting plans include a ton of great features. Learn about how to get a free SSL certificate, set up a staging site, andmore!

  • Deploy to Flywheel via SSH and GitHub Actions
  • Backups on Flywheel

View all

Platform Info

All the server and setting info you'll need to help you get the most out of your Flywheel hostingplan!

  • Database Access
  • Not recommended plugins
  • SFTP Access and Uploads

View all

Site Management

Tips and tricks for managing your sites on Flywheel, including going live, troubleshooting issues and migrating or cloning sites.

  • Managed Plugin Updates: Overview
  • Enable/Disable WP_CACHE
  • Point your DNS to Flywheel

View all

Developer Hub

Learn how to connect, deploy, and more with SSH on Flywheel's platform.

  • SSH tunneling to access your site’s database
  • Deploy to Flywheel via SSH and GitHub Actions

View all

Growth Suite

Learn more about Growth Suite, our all-in-one solution for freelancers and agencies to grow more quickly and predictably.

  • Getting started with Growth Suite
  • Growth Suite: What are invoice statuses?
  • Growth Suite: What do client emails look like?

View all

Managed Plugin Updates

Learn more about Managed Plugin Updates, and how you can keep your sites up to date, and extra safe.

  • Managed Plugin Updates: Database upgrades
  • Managed Plugin Updates: Pause plugin updates
  • Managed Plugin Updates: Plugin Security Alerts

View all

Flywheel help

Help is just a click away! Log into Flywheel dashboard to instantly chat with an expert, respond to a ticket, or follow along with in-depth documentation. We happily offer support 24 hours a day, 7 days a week, 365 days a year!

Log in

Launch your next WordPress site inminutes.

Free migrations

24/7/365 support

14 daydemosites

Fix “Sorry, this file type is not permitted for security reasons” error in WordPress (12)

Get started
  • Watch a demo video
  • Pricing
  • Sign up
  • Move site(s)
  • Go live
  • Become a partner!
Features
  • WordPress hosting
  • All-in-one SFTP
  • Collaborators
  • Billing transfer
  • Demo sites
  • Staging environment
Flywheel for
  • Agencies
  • Freelancers
  • High-traffic sites
  • Marketing teams
  • WooCommerce sites
  • All testimonials
Resources
  • Blog
  • Agency Directory
  • Free WordPress themes
  • Ebooks
  • Videos
  • Case studies
  • All resources
Company
  • About
  • Security
  • Careers
  • Life at Flywheel
  • Contact us
Customers
  • Get support
  • Help docs
  • App status
  • Product updates
  • Agency Partners
  • Referrals
  • Upgrade plan

Fix “Sorry, this file type is not permitted for security reasons” error in WordPress (13)

© 2013–2024 WPEngine, Inc. All rights reserved.
WP ENGINE®, VELOCITIZE®, TORQUE®, EVERCACHE®, and the cog logo service marks are owned byWPEngine,Inc. | Privacy Policy

Fix “Sorry, this file type is not permitted for security reasons” error in WordPress (2024)

FAQs

Fix “Sorry, this file type is not permitted for security reasons” error in WordPress? ›

For security reasons, WordPress restricts the file types you can upload through your WordPress dashboard. 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.

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

You get the “Sorry, This File Type Is Not Permitted for Security Reasons” error message when you try to upload a file type that's not supported in WordPress by default. WordPress limits the file types you can upload through your site's admin — images, videos, documents, audio — for security reasons.

What does sorry this file extension is not permitted for security reasons mean? ›

The “Sorry, this file type is not permitted for security reasons” error appears when you try to upload a prohibited file type. The reason behind these restrictions is to prevent security issues due to file uploading vulnerabilities.

How do I allow file types in WordPress? ›

Upon activation, go to the Settings » File Upload Types page in your WordPress admin area. Then, you can simply scroll through the list of preset file types or enter a file type into the search box. Next, check the boxes next to the file types that you want to enable.

How do I change the file type in WordPress? ›

Log in to your WordPress dashboard and go to Media > Library. Locate the file you want to change the extension for and click on the Edit button underneath it. On the Edit Media page, you'll see the file's URL and file type listed under the File Details section.

How do I fix file and folder permissions error in WordPress? ›

Simply right-click any folder or file from your web server and select the File Permissions option. This will open up a small box where you can change the file permissions. Unlike the cPanel, you can actually edit the value itself, thus for a Folder, enter 755, or for a file, enter 644. Click the “o*k” button to save.

How do I fix a file extension error? ›

Way 1. Change the File Extension
  1. Take an Excel file as an example. Open the Microsoft Excel software and go to the File tab.
  2. Select Export > Change File Type.
  3. Find the target file and change the file extension to a supported format. Then check if you can open the file.
Aug 18, 2023

How do you change the file extension? ›

Open the file as you normally would and select "Save As" from the File menu. Choose where you'd like the file to be saved, and use the "Save as type" drop-down menu to change the extension for your file. Then, hit "Save"—you can find the file wherever you chose to save it.

How do I change file permissions in WordPress? ›

Changing file permissions using cPanel File Manager

Go to My cPanel or My WordPress. Select File Manager. Right-click on your WordPress folder and select Change Permissions. Enter 755 in the Permission fields.

How do I check file permissions in WordPress? ›

iThemes Security is a WordPress security plugin designed to harden and lock down your WordPress site. The File Permissions setting lists file and directory permissions of key areas of the site. From the iThemes Security plugin menu, visit the Settings page, then click Tools. Locate the Check File Permissions section.

How do I fix file permissions in WordPress plugin? ›

Fix WordPress File permissions With Plugin
  1. Install and enable the All In One WP Security & Firewall plugin.
  2. In the left menu, hover over “WP Security”.
  3. Select the “Filesystem Security” menu item.
  4. You'll get a list of critical files and folders that it checks the permissions for.

How do I allow zip files to upload to WordPress? ›

Add the following snippet to your functions. php file. I have it as part of my theme: function allow_zip_uploads ( $existing_mimes=array() ) { $existing_mimes['zip'] = 'application/zip'; $existing_mimes['gz'] = 'application/x-gzip'; return $existing_mimes; } add_filter('upload_mimes', 'allow_brush_file_uploads');

How do I manually edit my WordPress site? ›

Access the WordPress Editor

To edit your website's overall structure, navigate to Appearance → Editor. Here, you can edit your site's menus, header, and footer. You can also edit the templates (which control the layout used by pages and posts) and patterns (content to reuse across multiple parts of your site).

What file types are allowed in Elementor? ›

This is our valid file type list: JPG, JPEG, PNG, GIF, PDF, DOC, DOCX, PPT, PPTX, ODT, AVI, OGG, M4A, MOV, MP3, MP4, MPG, WAV, WMV.

Why can't I upload to WordPress? ›

The image upload issue in WordPress is typically caused by incorrect file permissions. Your WordPress files are stored on your web hosting server and need specific file and directory permissions to work. Wrong file permissions prevent WordPress from reading or uploading files on the hosting server.

Why are my media files not uploading to WordPress? ›

The most common reasons your Media Library has stopped working properly are incompatible plugins and/or themes, WordPress HTTP error, and improperly set file permissions. Fortunately, any image upload issue can likely be resolved simply and quickly.

How do I allow TTF to upload to WordPress? ›

You can allow uploading the . ttf font on your site, by adding a simple filter code on function. php file. You can add more MIME type in the function to allow to upload those file.

Top Articles
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 6335

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.