Knowledgebase

Fixing "Sorry, This File Type Is Not Permitted for Security Reasons" Print

  • wordpress, troubleshooting, security, uploads, php, plugins, themes, suspension
  • 0

WordPress only allows a fixed list of file types in the media library.

Option 1 — use an allowed format

Convert the file first. This is the safest answer, especially for images and documents.

Option 2 — allow the type with a plugin

Install WP Extra File Types and enable the specific MIME type you need under Settings → Extra File Types.

Option 3 — allow it in code

Add to your child theme's functions.php:

function zkh_allow_types($mimes) {
    $mimes['svg'] = 'image/svg+xml';
    return $mimes;
}
add_filter('upload_mimes', 'zkh_allow_types');

A note on SVG and other risky types

SVG files can contain JavaScript, so only allow them if contributors are trusted, and sanitise them with a plugin such as Safe SVG.

Never allow uploads of .php, .phtml, .exe or .sh. Doing so effectively hands anyone who can upload a file the ability to run code on the server, and accounts doing this may be suspended.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot