How To Add SVG Images In Your WordPress Site

You can add or make SVG image working in your WordPress website by adding below mentioned code in respective files. Please follow below steps.

Step 1: Copy below provided code and open “/wp content/themes/hongo/functions.php” file under your project root folder. Now paste the copied code to the same file.

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

Step 2: Copy below provided code and open “/wp-content/wp-config.php” file under your project root folder and paste this line above where it says /* That’s all, stop editing! Happy publishing. */

define('ALLOW_UNFILTERED_UPLOADS', true);
SCROLL UP