How to enable Scalable Vector Graphics over WordPress?

I know you are here because you are getting issues with SVG image upload over WordPress Platform. WordPress Supports many Formats like .jpg, .png, jpeg, .gif, etc, but didn’t support SVG (Scalable Vector Graphics) Format due to security reasons. If you want to Enable SVG over WordPress then it’s quite simple.

How to enable Scalable Vector Graphics over WordPress?

In some situations, we need to add some SVG images over a website like logos, Feature Images, or Galleries in SVG format. We can add this format easily over other platforms but WordPress didn’t give you permission to upload SVG files over WordPress. In this article, I will tell you How we can enable these over the WordPress Platform.

There are two ways to enable SVG format over WordPress Website.

1) SVG Supported Plugin :

In the Market, there are a lot of plugins available to enable SVG format over WordPress. But I suggest one which is Good for Enable SVG format easily. You can use Plugin SVG Support to enable SVG format over the website.

How to enable Scalable Vector Graphics over WordPress?

You just need to install this plugin and activate it. After Activation, you can upload your SVG(Scalable Vector Graphics) format files over the WordPress media directory as per your need. This plugin is good and got great reviews over wordpress.org.

This Plugin is Great for those who haven’t the knowledge of coding. But if you are a developer then you have to use the WordPress hook to enable SVG format over the website. because Plugin will have extra features and scripts which will decrease your website performance. A developer can use the second Option.

2) Add code in function.php theme file :

If you are a developer then you need to add some code inside the function.php file which is located inside the theme directory.

You have to login inside Filezilla and edit the funtion.php file which is located inside the activated theme directory. You need to add code bottom of the file.


function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
}
add_filter('upload_mimes', 'add_file_types_to_uploads');

Save your changes inside the file and close it. Now you can upload SVG images as well over the website as per your need.

I hope your issue has been fixed over the website. If you want more Informational Articles then you can visit our website https://summyifi.com.

Hope you enjoyed it. Thank you

Tags: How to enable Scalable Vector Graphics over WordPress?, scalable vector graphics, svg file format, svg vector

Leave a Reply

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