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 🙂 

Submit a Comment

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


Select Categories