WordPress Developer Ukraine, Kyiv
I can’t upload SVG files

I can’t upload SVG files

“Sorry, this file type is not permitted for security reasons.” Even after adding the standard upload_mimes filter, some SVG files still trigger “Sorry, this file type is not permitted for security reasons.” In most cases, a missing XML declaration at the top of the SVG file is what causes the server-side MIME check to fail.
Allow upload SVG files to WordPress

Allow upload SVG files to WordPress

How to allow SVG uploads in WordPress SVG is the format of choice for logos and icons, but WordPress blocks it out of the box. There are two ways to enable it: install a plugin, or add a small filter to your theme or plugin code.