TABLE OF CONTENTS

Explore Our Other Insights!

Related Posts
Related Categories
Step-by-Step Guide to Fixing the ‘File Type Not Permitted’ Error in WordPress

Step-by-Step Guide to Fixing the ‘File Type Not Permitted’ Error in WordPress

Introduction

WordPress is one of the most popular content management systems in the world, but even this robust platform can sometimes leave users scratching their heads with errors. One such frustrating problem is the ‘File Type Not Permitted’ error. This error pops up when you try to upload a file format that WordPress doesn’t support by default.

But don’t worry; this guide will walk you through step-by-step solutions to resolve the issue. Whether you’re a beginner or a seasoned WordPress user, this comprehensive article will help you troubleshoot and fix the problem efficiently.

What Causes the ‘File Type Not Permitted’ Error in WordPress?

WordPress has a predefined list of allowed file types, such as images, documents, and videos. When you attempt to upload a file that doesn’t match the supported formats, WordPress blocks the upload to maintain security and functionality.

Here are the most common causes:

  1. Unsupported File Format: By default, WordPress allows file types like .jpg, .png, .pdf, and .mp4. Formats like .svg or custom file types aren’t supported.
  2. Server Restrictions: Sometimes, hosting providers set limits on what types of files can be uploaded.
  3. File Size Issues: Files exceeding the size limit can also trigger this error.
  4. Incorrect MIME Type Detection: WordPress checks the MIME type of a file during upload. If the server misidentifies it, the file gets blocked.

Take Your WordPress Site to the Next Level!

 Customize, optimize, and grow with SDLC CORP’s tailored solutions.

wordpress development services

Step 1: Check WordPress Allowed File Types

First, ensure that the file type you’re trying to upload is supported. Here’s a list of default file types permitted by WordPress:

  • Images: .jpg, .jpeg, .png, .gif, .ico
  • Documents: .pdf, .doc, .docx, .ppt, .pptx, .odt
  • Videos: .mp4, .m4v, .mov, .wmv
  • Audio: .mp3, .ogg, .wav

If your file type isn’t listed above, you’ll need to allow it manually (covered in Step 4).

Step 2: Check for File Size Limitations

Sometimes, the issue isn’t the file type but its size. WordPress has a maximum upload file size limit, often set by your hosting provider.

How to Check Your File Size Limit:

  1. Go to your WordPress dashboard.
  2. Navigate to Media > Add New.
  3. Look at the message below the upload box. It will say something like “Maximum upload file size: 2 MB.”

Solution for File Size Issues:

  • Increase File Upload Limit: Edit the php.ini or .htaccess file of your server. Add or modify the following lines:

php

Copy code

upload_max_filesize = 64M  

post_max_size = 64M  

max_execution_time = 300

  • Contact Your Hosting Provider: If you’re on shared hosting, ask your hosting provider to increase the limit.

Step 3: Rename the File

WordPress might block files with special characters or spaces in their names. To resolve this:

  1. Rename your file to something simple, like example-file.jpg.
  2. Avoid using symbols like @, #, &, %, or spaces.

Step 4: Enable Additional File Types Using a Plugin

The easiest way to add support for unsupported file types is through a plugin.

Recommended Plugins:

  1. WP Extra File Types
  2. File Upload Types by WPForms

How to Use WP Extra File Types:

  1. Install and activate the plugin.
  2. Go to Settings > Extra File Types in your WordPress dashboard.
  3. Select or add the file types you want to allow, such as .svg or .json.
  4. Click Save Changes.

This method is beginner-friendly and doesn’t require coding knowledge.

File Type Not Permitted’ Error-wordpress

Step 5: Manually Add Support for Custom File Types

If you’re comfortable with editing your site’s code, you can manually allow additional file types.

Edit the functions.php File:

  1. Go to your WordPress dashboard.
  2. Navigate to Appearance > Theme File Editor.
  3. Open the functions.php file.
  4. Add the following code:

php

Copy code

function custom_mime_types($mimes) {  

    $mimes[‘svg’] = ‘image/svg+xml’;  

    $mimes[‘json’] = ‘application/json’;  

    return $mimes;  

}  

add_filter(‘upload_mimes’, ‘custom_mime_types’);

5. Save the file.

This code adds support for .svg and .json files. You can modify it for other formats.

Tired of Website Downtime?

 Switch to SDLC CORP for reliable WordPress hosting and maintenance services.

wordpress

Step 6: Fix MIME Type Issues on the Server

Sometimes, the server misidentifies a file’s MIME type, leading to upload errors.

Solution:

  1. Check Server Configuration: Ensure your server recognizes the file’s MIME type. For instance, .svg files should have the MIME type image/svg+xml.
  2. Modify the .htaccess File: Add the following lines to fix MIME type issues:

apache

Copy code

AddType image/svg+xml .svg

AddType application/json .json

3. Save and test the upload again.

Step 7: Fix Permissions Issues

File upload errors can sometimes result from permission problems.

How to Check and Fix Permissions:

  1. Use an FTP client like FileZilla to connect to your website.
  2. Navigate to the wp-content/uploads folder.

Ensure the folder’s permissions are set to 755 or 775.

Step 8: Enable Debug Mode in WordPress

If none of the above steps work, enable debugging to get more details about the error.

How to Enable Debug Mode:

  1. Open your website’s root directory using FTP or cPanel.
  2. Locate the wp-config.php file.
  3. Add the following lines before /* That’s all, stop editing! */:

php

Copy code

define(‘WP_DEBUG’, true);  

define(‘WP_DEBUG_LOG’, true);  

4. Check the debug log for error details in the wp-content/debug.log file.

Unlock Your Website’s Potential!

Get expert WordPress development and customization services tailored to your business needs

Wordpress

Step 9: Test Upload in a Fresh Installation

If you’re still facing issues, test the upload in a fresh WordPress installation to rule out theme or plugin conflicts.

Bonus Tips to Avoid Future Errors

  1. Regular Updates: Keep your WordPress, themes, and plugins up to date.
  2. Choose Reliable Hosting: Use hosting providers that support a wide range of file types and offer flexible limits.
  3. Backup Your Site: Always have a backup before making changes to your site.
  4. Use Secure Plugins: Ensure the plugins you use for file uploads are well-rated and regularly updated.

Final Thoughts

The ‘File Type Not Permitted’ error can be frustrating, but it’s fixable. By following the steps outlined in this guide, you can resolve the issue and safely upload the files you need.

WordPress is a versatile platform, and with a bit of troubleshooting, you can overcome most errors. If you have specific questions or face unique challenges, don’t hesitate to reach out for expert help.

Have you encountered this error before? Share your experience in the comments below, and let’s troubleshoot together!

This guide is crafted to ensure your WordPress experience remains smooth and error-free. Let us know if it helped, and don’t forget to bookmark this article for future reference!

SDLC CORP WordPress Development Services

SDLC CORP offers expert WordPress Development Services to help businesses build tailored, high-performing, and visually appealing websites. As a trusted WordPress Development Company, we specialize in creating custom themes, developing plugins, and ensuring seamless integrations to cater to your unique business requirements. From e-commerce solutions to corporate websites, our team delivers secure, scalable, and user-friendly platforms designed to grow with your business. Whether you need a website from scratch or want to enhance an existing one, SDLC CORP is your go-to partner for WordPress excellence. Let us turn your vision into a reality with innovative and reliable solutions!

Facebook
Twitter
Telegram
WhatsApp

Subscribe Our Newsletter

Contact Us

File a form and let us know more about you and your project.

Let's Talk About Your Project

sdlccorp-logo
Trust badges
Contact Us
For Sales Enquiry email us a
For Job email us at
USA Flag

USA:

5214f Diamond Heights Blvd,
San Francisco, California, United States. 94131
UK Flag

United Kingdom:

30 Charter Avenue, Coventry
 CV4 8GE Post code: CV4 8GF United Kingdom
Dubai Flag

Dubai:

Unit No: 729, DMCC Business Centre Level No 1, Jewellery & Gemplex 3 Dubai, United Arab Emirates
Dubai Flag

Australia:

7 Banjolina Circuit Craigieburn, Victoria VIC Southeastern Australia. 3064
Dubai Flag

India:

715, Astralis, Supernova, Sector 94 Noida, Delhi NCR India. 201301
Dubai Flag

India:

Connect Enterprises, T-7, MIDC, Chhatrapati Sambhajinagar, Maharashtra, India. 411021
Dubai Flag

Qatar:

B-ring road zone 25, Bin Dirham Plaza building 113, Street 220, 5th floor office 510 Doha, Qatar

© COPYRIGHT 2024 - SDLC Corp - Transform Digital DMCC

Skip to content