WordPress SVG for Perfect Graphics without a plugin

While WordPress SVG files aren’t natively allowed to be uploaded to a WordPress website there is a work around. With a simple code placed in your functions.php file you can be uploading svg files in no time all without an extra plugin.

Use caution when using this method on websites where you allow files to be uploaded by users on their end. There could be some security issues by allowing users to upload this file type hence the lack of support from the WordPress template files.

This is a great place to get started in using .svg’s in WordPress which will bring scalable, lossless graphic into your unique design.

Here is the code:

function cc_mime_types($mimes) {
 $mimes['svg'] = 'image/svg+xml';
 return $mimes;
 add_filter('upload_mimes', 'cc_mime_types');


The rest is up to you. Get coding, add transitions with css and feel free to share your results below.

Related Post

Share This