WordPress – allow SVG to be uploaded to Media Library

Install SVG Support plugin

Download from: https://wordpress.org/plugins/svg-support/

or if using Composer:

composer req "wpackagist-plugin/svg-support":"*"

For each SVG to be uploaded, make sure the xml declaration is at the beginning of the SVG

Open SVG with text editor

Add the beginning, add the following:

<?xml version="1.0" encoding="utf-8"?>