WordPress by default does not allow the upload of any type of file to the media library, for both security and compilation reasons. You can fine the allowed files here: https://wordpress.com/support/accepted-filetypes/

The media library in fact re-processes all the data it receives and categorises it according to the meta-data contained in each file.

But what if you want to add an unauthorised file, such as an SVG or any other type of extension that is not allowed?

To remove the block, we need to add a line of code in the wp-config.php file

The line to add is: define (‘ALLOW_UNFILTERED_UPLOADS’, true );

There are two ways to modify wp-config.php:

  1. via the cpanel file manager
  2. via the file manager of the wordpress plugin ‘WP File Manager’
This image has an empty alt attribute; its file name is 2020-12-02-11_29_30-cPanel-Main-Opera.png

In the first case, just click on the ‘File Manager’ icon and enter the public_html folder or the folder of the additional domain you are interested in – select the wp-config.php file – right click: ‘edit’ – add define (‘ALLOW_UNFILTERED_UPLOADS ‘, true); At the end of the file.

This image has an empty alt attribute; its file name is 2020-12-02-11_37_20-File-Manager-–-WordPress-plugin-_-WordPress.org-Opera.png

If you do not have access to the cpanel, you can install the WP FIle Manager plugin which will give the possibility to carry out the same procedure in a very similar way, but directly from your WordPress control panel.

Wish you all the best in your work!

Leave a Reply

Your email address will not be published. Required fields are marked *