Contact Us

If you’ve ever tried to upload a file to your WordPress site and suddenly got hit with the error:

“Sorry, you can’t upload this file type for security reasons.”
or
“You can’t add this file type.”

…then you’re not alone.

This is one of the most common upload problems WordPress users face.

The good news?

This error is easy to fix — safely — without breaking your site security.

In this complete guide, you will learn:

  • Why WordPress blocks certain file types

  • What file types WordPress supports

  • How to safely allow new file types

  • Exact fixes using plugins, code, hosting, and cPanel

  • How to fix the error for SVG, WebP, JSON, CSV, ZIP, EXE, APK, and more

  • Security tips (VERY important)

  • Common FAQs to give you easy solution

Let’s begin!

What Does “You Can’t Add This File Type” Mean in WordPress?

WordPress blocks certain file formats from being uploaded to protect your website from:

  • malware

  • viruses

  • executable files

  • malicious scripts

  • corrupted attachments

Every file has a MIME type (Multipurpose Internet Mail Extensions), which helps WordPress recognize the file’s purpose.

Example:

  • .jpg → image/jpeg

  • .png → image/png

  • .pdf → application/pdf

  • .svg → image/svg+xml

If a file’s MIME type is not approved, WordPress instantly stops the upload.

Thus, the error happens because:

  • The file type is not allowed

  • The MIME type does not match

  • The server blocks the file

  • WordPress settings block unfiltered uploads

  • A plugin interferes with allowed file types

Now let’s fix it.

Supported File Types in WordPress (Default)

WordPress allows these file types without modification:

Images

  • JPG / JPEG

  • PNG

  • GIF

  • WebP

  • ICO

To improve performance and speed, it’s a good idea to optimize these image formats using a reliable tool. Here’s a full breakdown of the best WordPress image optimization plugins, including detailed comparisons.

You can also improve your site’s loading speed by enabling lazy loading for images. Here’s a complete guide on how to enable and optimize lazy loading in WordPress for better performance.

Documents

  • PDF

  • DOC / DOCX

  • PPT / PPTX

  • XLS / XLSX

  • ODT

  • PSD

  • RTF

  • TXT

Audio

  • MP3

  • WAV

  • OGG

Video

  • MP4

  • MOV

  • WMV

  • AVI

Archives

  • ZIP

Anything outside this list will trigger the “You can’t upload this file type” error.

Common File Types WordPress Blocks

These often cause the error:

  • SVG

  • JSON

  • CSV

  • PSD (sometimes)

  • WebP (older sites)

  • EXE

  • APK

  • RAR

  • TTF / OTF (fonts)

  • CSV

Now let’s fix this problem using safe and recommended methods.

Fix 1: Enable Unfiltered Uploads (Easiest and Safe for Admins Only)

If you are the admin and trust the files you’re uploading, this is the fastest fix.

Add this to your wp-config.php above the line:

/* That's all, stop editing! Happy publishing. */

define('ALLOW_UNFILTERED_UPLOADS', true);

Pros

  • Works for all file types instantly

  • Fastest fix

Cons

  • Only recommended for trusted admins

  • Not recommended for sites with multiple authors

Fix 2: Use a File Upload Plugin (Safest for Beginners)

The best way to allow new file types without touching code is using a plugin.

Recommended Plugins

  1. WP Extra File Types

  2. File Upload Types by WPForms

  3. MIME Types Plus

How to Use WP Extra File Types

  1. Install → Activate

  2. Go to Settings → Extra File Types

  3. Tick the file types you want

  4. Save

Supports:

  • SVG

  • JSON

  • CSV

  • ZIP

  • WebP

  • Custom types

Why this method is great

  • Beginner-friendly

  • No risk of breaking site

  • No coding needed

If the changes don’t show immediately, your site may be loading an old cached version. Clearing your cache usually fixes this issue. Here’s a full comparison of the best WordPress caching plugins to help you choose the right one and boost your site performance.

Fix 3: Allow Specific MIME Types via functions.php (Safe Method)

If you want a developer-friendly method, add this code to your theme’s functions.php:

function wpthrill_custom_allowed_mimes($mimes) {
$mimes['svg'] = 'image/svg+xml';
$mimes['json'] = 'application/json';
$mimes['csv'] = 'text/csv';
$mimes['webp'] = 'image/webp';
return $mimes;
}
add_filter('upload_mimes', 'wpthrill_custom_allowed_mimes');

You can add more as needed.

Pros

  • Clean

  • Developer-friendly

  • Safe

Cons

  • Code can be lost after theme update unless child theme is used

Fix 4: Fix MIME Type Issues via Hosting (cPanel / DirectAdmin)

Sometimes hosting providers block certain MIME types. WordPress blocks unsupported file types or throws errors when server-level file permissions cause conflicts. Sometimes you may even face related issues like the destination folder already exists error in WordPress when uploading themes or plugins.

To fix via cPanel

  1. Go to cPanel → MIME Types

  2. Add the missing MIME type

Example for SVG:

  • Extension: svg

  • MIME Type: image/svg+xml

To fix via .htaccess

Add:

AddType image/svg+xml svg
AddType application/json json
AddType text/csv csv

Fix 5: Disable Security Plugins Blocking Uploads

Plugins like:

  • Wordfence

  • Sucuri

  • iThemes Security

  • All-In-One Security

…sometimes block file uploads. If you’re not sure which security plugin you’re using or want to choose a better one, check out this list of the best WordPress security plugins, where we review the top options and compare features.

To fix

  1. Temporarily disable the security plugin

  2. Upload the file

  3. Re-enable the plugin

  4. Add allowed file type inside plugin settings

Fix 6: Fix Incorrect File Extensions

Sometimes the file extension looks correct but the actual file type is wrong.

Example:

  • A .jpg that is actually a .webp

  • A .svg with scripts inside it

Solution:
Convert the file using an online converter or image editing software.

Fix 7: Upload via FTP (Bypass WordPress Restrictions)

If nothing works:

  1. Open FileZilla / cPanel File Manager

  2. Upload the file to /wp-content/uploads/2025/

  3. Copy file URL

  4. Paste into WordPress

This bypasses MIME checks.

Fix 8: Allow SVG (Special Case)

SVG is powerful but risky because it can contain scripts.

Only allow trusted SVG files!

Use the Safe SVG plugin.

It sanitizes SVGs before upload.

Fix 9: Fix for Multisite Users

If you’re using WordPress Multisite:

WordPress blocks many file types at the network level.

Fix

Go to:

Network Admin → Settings → Upload Settings → Allowed file types

Add the file type.

Fix 10: Check PHP Version & Server Restrictions

Old PHP versions cause upload issues.

Minimum recommended: PHP 8.1+

Ask your host to update it for you.

Common File Types and How to Allow Each One

Allow SVG

$mimes['svg'] = 'image/svg+xml';

Allow WebP

$mimes['webp'] = 'image/webp';

Allow JSON

$mimes['json'] = 'application/json';

Allow CSV

$mimes['csv'] = 'text/csv';

Allow ZIP

(Usually already enabled)

$mimes['zip'] = 'application/zip';

Allow EXE / APK / RAR (Not recommended)

These file types can be dangerous.

If you must allow:

$mimes['exe'] = 'application/octet-stream';
$mimes['apk'] = 'application/vnd.android.package-archive';
$mimes['rar'] = 'application/x-rar-compressed';

Security Warning (VERY IMPORTANT)

Allowing risky file types (SVG, EXE, APK, JS, PHP, HTML) can expose your website to:

  • Malware

  • XSS attacks

  • Shell scripts

  • Server takeover

Always follow these safety tips:

  • Allow only the file types you truly need

  • Only admins should upload files

  • Scan files before uploading

  • Keep backups

Best Method Recommended (Safe + Easy)

Use:

File Upload Types by WPForms

It’s safe, beginner-friendly, supports custom MIME types, and prevents harmful files.

Conclusion

If you’ve tried everything and the error still won’t go away, don’t waste hours fighting WordPress. Get instant help from our experts with our Emergency WordPress Support service, available 24/7 for urgent fixes.

The “You can’t add this file type” error in WordPress is very common and usually easy to fix. Whether you choose a plugin, code snippet, wp-config update, or server-side fix — the error can be resolved within minutes.

Just remember:

  • Allow only trusted file types

  • Prefer plugins for safety

  • Use code only if you’re comfortable

  • SVGs must be sanitized

  • For risky file types, be extremely careful

If you follow this guide, you’ll never struggle with file upload restrictions again. To avoid future upload errors and keep your site running smoothly, follow this essential WordPress maintenance checklist, which covers updates, backups, cleanups, and performance checks.

FAQs About “You Can’t Add This File Type” in WordPress

1. Why does WordPress block file types?

To prevent malicious scripts and dangerous files that can infect your website.

2. Is it safe to allow all file types?

No. Only allow file types you trust.

3. How do I fix this error without plugins?

Use the upload_mimes filter in functions.php.

4. Why is SVG not allowed?

Because SVG can contain JavaScript, making it a security risk.

5. Does this error affect WooCommerce uploads?

Yes, WooCommerce still uses WordPress upload rules.

6. How do I allow file types for all users?

Add allowed MIME types in Network Admin (for multisite) or via plugin.

Subscribe To Our Newsletter & Get Latest Updates.

Copyright @ 2025 WPThrill.com. All Rights Reserved.