Android

Today we will solve “Sorry, this file type is not permitted for security reasons WordPress error”.

Wordpress

If you try to upload a file which is not allowed, it will present you with a “Sorry, this file type is not permitted for security reasons” error message.

You can easily fix this error by following solutions below,

UPDATE :

There is currently a known issue with the allowed mime types in WordPress 4.7.1 and a bug has been logged for this.

There are several ways to solve the,

“Sorry, this file type is not permitted for security reasons” error message in WordPress.

FIRST SOLUTION : 

There are several WordPress plugins which you can simply install to fix the problem. Each plugin has it’s own configuration or settings.

Here are some plugins you can use:

WP ADD MIME TYPES

PRO MIME TYPES

MIME TYPES PLUS

SECOND SOLUTION :

Open the wp-config.php file of your WordPress installation and above the line where it says :

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

THIRD SOLUTION :

With this option, you’ll write your own code to hook to the upload_mimes filter of WordPress and add your mime type accordingly.

First, you’ll need to check what the extension of your file is eg. SVG and then you need to check what the mime type of that file extension is specifically.

The code you’re going to write can be placed in various places but best is to just add it to the functions.php file of your WordPress theme.

So go ahead and open the functions.php file of your WordPress theme and at the very top, add this following code:

You can choose any solutions but i will go with SECOND SOLUTION. 🙂

Happy Coding!

Cheers!

LEAVE A REPLY

Please enter your comment!
Please enter your name here