How To Change Upload File Format In WordPress

12

Let’s get started, shall we?

Today i will show you how to change/modify upload file format in WordPress using  cPanel and File manager Plugin in WordPress.

Step 1:

Let's Login to you cPanel by (example: www.yourdomain.com/cpanel )

Login using cPanel Credentials by using the URL www.yourdomain.com/cpanel or using port number www. yourdomain.com:2083 the port number is differ by in which the port the cpanel&whm installed in the hosting server.

Step 2:

Now go to you cPanel file manager find the function.php file in where the WordPress installed folder

function.php file path:  in WordPress installed folder Go to –> wp-includes –> fucntion.php

Edit function.php file by  –> Select –> Right Click the function.php and click –> EDIT

Step 3:

Edit function.php file

Find the line number 2535 add the file format in the apply_filter function. example now i am going the add webp format by default WordPress media library does not support webp format.   

Add file format in Line no: 2535

You can change/ modify/ add/ delete Image, Video, Documents, Audio all type of file format. update on ‘wp_get_image_mime’ ‘, ‘wp_get_video_mime’, etc array function.

Before Editing webp image format

Add image formate or file format "only add file extention (example: png, svg , jpg)"

After adding webp image format

Add file format in Line no: 2721

You can change/ modify/ add/ delete Image, Video, Documents, Audio all type of file format. update on ”mime_type’ array function.

Before Editing webp image format
After adding webp image format

Add file format in Line no: 2847

You can change/ modify/ add/ delete Image, Video, Documents, Audio all type of file format. update on ”ext2type’ array function.

Before Editing webp image format
After adding webp image format

Save the function.php file

function.php Saved successfully

Step 4:

Login to your WordPress dashboard

Login to wp-admin

Step 5:

Upload the "webp image file" test the change

In WordPress dashboard :”Go to in Media —> Library —> New Image  —> Upload the Webp image file

Before Uploading the webp image file format
file format change
After uploading the webp image file format

Successfully we modified upload file format in WordPress media library

Thank you all!!!

Leave A Reply

Your email address will not be published.