SVG Upload to WordPress Issue

I’ve established this is a plugin/theme conflict. I will report back when I know more. I tested this on a couple of my other client’s websites that are on different servers but share similar themes/plugins, and sure enough, I can upload SVGs.

How to prevent WordPress to remove my embedded SVG images

I think you are missing dimension properties (height and width) while adding it in HTML, that’s why it is not appearing. For SVG files height and width is compulsory if you align it center or left without giving dimensions property it will break. I faced the same issue when I started my ChartExpo project.

SVG image upload stopped working

By default, WP does not allow SVG uploads, and you should get that error. Preventing SVG uploads is a security feature (which I explain below). I can’t help you debug your function, because that is beyond my expertise, but I can suggest a work around. You can use a plugin like SafeSVG (https://wordpress.org/plugins/safe-svg/) to enable … Read more

Ways to handle SVG rendering in wordpress?

Take a look at wp_prepare_attachment_for_js(), which is what gathers attachment metadata for use on the Media pages. The eponymous filter lets us add or alter metadata. The following example can be dropped into functions.php. Note: this requires SimpleXML support in PHP. function common_svg_media_thumbnails($response, $attachment, $meta){ if($response[‘type’] === ‘image’ && $response[‘subtype’] === ‘svg+xml’ && class_exists(‘SimpleXMLElement’)) { … Read more

SVG files not uploading since most recent WP update

In WordPress 4.7.1 a change was introduced that checks for the real mime type of an uploaded file. This breaks uploading file types like SVG or DOCX. There already exist tickets for this issue in WordPress Core, where you can read more about this: Some Non-image files fail to upload after 4.7.1 (https://core.trac.wordpress.org/ticket/39550) SVG upload … Read more