SVG <animate> issues in the MEDIA LIBRARY
Hi,
I'm using the "Car Wash 3" theme, and when I save the animated SVG file 'carwash3-home-pic1.svg' (which uses the <animate> tag) to my desktop and then re-upload it to the WordPress media library (so that the preview appears there), the <animate> tag gets removed!
I've tried everything—disabling SVG sanitization and more—but nothing works. I'm going crazy!
How do you upload animated SVG images without WordPress stripping out the <animate> tag?
Thanks
Comments
Hi,
Are you sure that it was not removed by the program you used for the SVG editing?
BTW which program did you use?
Best regards
Hi Phil! I'm not using any software to edit the original SVG from the theme. I simply download it and re-upload it to the media library, which removes the tag, making the image static and without the theme's original animation.
P.S. I'm doing this so that WordPress generates a preview of the image in the media library, as all SVGs appear without a preview for me.
🙂
Thanks for the clarification.
I consulted with the dev team about this, and it was introduced in version 27.5.6.
https://support.muffingroup.com/changelog/
Since this version of SVG files are trimmed from vulnerable tags, and animate is one of them.
As a workaround, you can disable SVG upload from Theme options -> Global -> Advanced, and install some plugin that allows to upload animated SVGs:
We cannot recommend any other plugins then the ones we support:
https://support.muffingroup.com/documentation/bundled-plugins/#compatibility
Best regards
Thanks, Phil! You cracked the code! I'll do that. 😎