Do you need to add files to your website that WordPress does not generally support?
WordPress allows you to upload a variety of file kinds, including pictures, videos, audio files, and office documents. However, some site owners are required to upload unsupported files.
We’ll show you how to add additional file types to your WordPress uploads in this article.
To make your WordPress website safe, you should only upload the most often used file types. There is likewise a most extreme size limit on the documents that can be transferred.
You can watch the video tutorial below for this article:
By default, the following file types and extensions are permitted:
Images in the following formats: .jpg, .jpeg, .png, .gif, .ico
Document formats include: .pdf, .doc, .docx, .ppt, .pptx, .pps, .ppsx, .odt, .xls, .xlsx, and .PSD.
Audio formats include: mp3, .m4a, .ogg, and .wav.
Video formats include: mp4, .m4v, .mov, .wmv, .avi, .mpg, .ogv, .3gp, and .3g2.
However, because several file formats can be abused and pose a security concern, WordPress does not permit them by default:
Images such as.svg and.bmp
Documents such as.psd,.ai, and.pages
Code files such as.css,.js, and.json are examples of code files.
Video formats such as.flv,.f4l, and.qt
On the off chance that you attempt to transfer unsupported record types to your WordPress site, you will see the mistake message, ‘Sorry, you are not permitted to upload this file type.’
Consider a state of affairs in that you actually need to transmit an unsupported record type. You could use FTP or your WordPress host’s file manager to upload the files, but that’s not as handy as utilizing the built-in WordPress media library or a file upload form.
Let’s look at how to add different file formats for uploading in WordPress.
Now, by default WordPress only allows you to upload certain types of files and this is due to security and a few other reasons.
In case you wish to check it first,
- Let’s go to Media.
- Then, click on the Library.
- There you’ll see an option to add different types of new files called Add New.
- Now, after clicking on Select Files, if you try uploading a PSD File over here, you’ll see there is an error and it says that ‘Sorry, This File Type is not permitted for security reasons.’
Hence, let’s go ahead with the steps to further learn how to exactly add additional file types that are to be uploaded in WordPress.
- Go in your WordPress dashboard.
- Hover directly to Appearance and click on on Theme Editor.
- Now, at the proper hand side, click on on Theme Functions.
- Further scroll down through the codes.
- You have to add a small piece of code.
NOTE: Before making any code-related changes, it is suggested to have a backup of your
website JUST IN CASE anything goes wrong, then you can at least restore it afterwards.
Now, you have to add the following code at the end.
CODE:
function my_myme_types($mime_types){
$mime_types[‘svg’] = ‘image/svg+xml’; //Adding svg extension
$mime_types[‘psd’] = ‘image/vnd.adobe.photoshop’; //Adding photoshop files
return $mime_types;
}
add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);
Now, you’ll see that the mime types are being mentioned so that you can add more as per your root need that whatever kind of files you want to upload.
- Once you’re achieved with this, move beforehand and click on at the Update File to shop it.
- When the file is finally updated, you can further go and check if you’re being allowed to upload PSD Files.
- So you can go to Media and click on the Library.
- Then click on Add New, and then Select Files and check whether PSD Files are being uploaded or not.
As long as you followed our steps correctly, it must be allowed to get uploaded.
0 Comments