Categories: WordPress

How to allow SVG file on WordPress

In this topic, We are learning  How to allow SVG files on WordPress.

For security, reason defaults WordPress not allow to upload SVG files.

 

Let’s Start,

1.  First, you need to edit your theme function file. You can edit function file from Dashboard via appearance or FTP.

2.  Now, Open the function file and just put the below code to your function file.

/**
 * give permission for upload SVG file
 * 
 */function custom_svg_upload( $mimes ) {
 
 // New allowed mime types.
 $mimes['svg'] = 'image/svg+xml';
 $mimes['svgz'] = 'image/svg+xml';
 $mimes['doc'] = 'application/msword';
  
 // Optional. Remove a mime type.
 unset( $mimes['exe'] );
  
 return $mimes;
 }
add_filter( 'upload_mimes', 'custom_svg_upload' );

 

3.  Now refresh the front side and now you will be able to add SVG files in your WordPress media.
It allows to Upload of SVG files.

Please review the video.

I hope you guys found something useful 🙂 

Fenal Kalathiya

Junior WordPress Developer. Good skills in WordPress, PHP, HTML, CSS, and jQuery.

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

2 years ago