SVG Issues
-
Greetings all – Like many people, I have again encountered issues when working with SVG files. So I did a little testing and found some interesting things.
On a brand-new WordPress 5.7.1 install, I attempted to upload a file called logo.svg using the media manager. The action failed with the following message: Sorry, this file type is not permitted for security reasons. Fair enough.
I next went to a WordPress install that has been around for 2-3 years and has already been upgraded to version 5.7.1. I used the media manager and I *was* able to upload the file successfully. I see the frame for the uploaded file, and the dimensions, but not the thumbnail. This site has never had any type of SVG file plugin installed on it. Never.
I installed a WordPress 5.7.1 on a different account and then installed Astra Pro and imported a starter template from their library. There are a few SVG files included in this template, and I can see them in the media manager along with their thumbnails.
When I tried to upload my logo image file to this new install, I got the same error message as on the new site mentioned above. So I installed several different SVG plugins one at a time, and each allowed me to upload the SVG logo file. Unfortunately, none of them allowed me to see the thumbnail, and when I attempted to replace the stock logo image in the template, no logo showed up.
The next thing I tried was using the ‘Add From Server’ plugin. I uploaded the file to the appropriate image folder and then imported the file using this plugin. I see the frame around a blank thumbnail in the media manager but not the image itself.
The final thing I tried was renaming the existing logo image file that came with the template and then naming my uploaded file the same thing. Unfortunately, that did not work as I had hoped. The thumbnail was gone and I could not see anything in the frontend either.
Like many others, I am disappointed in WordPress not offering native SVG support. I understood the arguments against this years ago. But with the plugins available to perform the sanitizing of the SVG files, what possible reason could there be for not including this in WordPress core?
For the moment, assume it just isn’t going to happen and users need to install plugins to get this functionality. I would be okay with that, but none of them seem to work properly. So what does someone in my position do? SVG files are not going away, nor should they.
Has anyone discovered a solution for supporting SVG files that functions correctly and consistently?
- The topic ‘SVG Issues’ is closed to new replies.