Back to Community

Troubleshooting Common SVG Display Issues in WordPress

16 threads Sep 7, 2025 PluginSvg support

Content

Scalable Vector Graphics (SVGs) are a fantastic way to add sharp, responsive graphics to your WordPress site. However, getting them to display consistently across all browsers and devices can sometimes be challenging. Based on community reports, here are the most common SVG display problems and their solutions.

1. SVG Appears Very Small or Distorted in Internet Explorer 11

The Problem: Your SVG loads correctly for a moment in IE11 but then suddenly shrinks to a very small size or becomes distorted.

Why It Happens: This is a well-documented quirk of Internet Explorer 11. The browser often has trouble interpreting the viewBox and width attributes of an SVG file, defaulting to a small, fixed size.

Potential Solutions:

  • Use an <object> Tag: A common workaround is to bypass the <img> tag entirely. Instead of inserting your SVG as an image, use an HTML <object> tag with the width set to 100%.
    <object class="your-class" width="100%" data="/path-to/your-image.svg" type="image/svg+xml"></object>
  • Apply CSS Fixes: You can try forcing a specific width via CSS. Inspect the element in IE11 to see what size it's rendering at and then override it with a more appropriate width rule.

2. SVG Does Not Display or Appears Broken on Mobile Devices (iOS/Android)

The Problem: Your SVG looks perfect on desktop browsers but fails to appear, appears as a broken image, or shows the wrong font on iPhones, iPads, or Android devices.

Why It Happens: This can be caused by several factors:

  • External Hosting: The SVG file is hosted on an external server or CDN. Some browsers, especially on mobile, may not inline or render these correctly.
  • Missing Width: The SVG is rendering but has a computed width of 0px, making it invisible.
  • Embedded Fonts: The SVG uses a custom font that is not available on the mobile device, causing the text to render incorrectly or not at all.
  • File Errors: The SVG file itself may contain errors or code that certain mobile browsers strip out for security reasons.

Potential Solutions:

  • Host SVGs Locally: Ensure all SVG files are uploaded to and served from your own WordPress media library.
  • Set a CSS Width: Explicitly define a width for the SVG in your CSS. For a logo, this might look like:
    header .custom-logo-link img {
        width: 300px;
    }
  • Convert Text to Outlines: If text appears in the wrong font, open the original SVG file in a vector editor like Adobe Illustrator and convert all text to outlines/paths. This embeds the letter shapes directly into the SVG, removing dependency on external fonts.
  • Check for 404s: Use your browser's developer tools (on desktop) to check the Network tab for 404 errors. This will tell you if the browser is failing to fetch the SVG file from your server.

3. SVG is Not Clickable on Mobile

The Problem: Links or interactive elements within an inline SVG work on desktop but are not tappable on mobile devices.

Why It Happens: This is almost always an issue within the SVG file's own code, not the plugin. The layers or elements containing the links may be incorrectly structured.

Potential Solutions:

  • Inspect the SVG Code: Open the raw .svg file in a code editor. Ensure that the <a> (link) tags are correctly wrapped around the elements you want to be clickable and that they have the proper xlink:href attributes.
  • Re-export the SVG: Sometimes, the software used to create the SVG can export messy code. Try re-exporting the graphic from your vector editor with different settings focused on simplicity.

4. Parts of the SVG Code Are Stripped Out

The Problem: After uploading, certain elements like <feFlood> or <feBlend> (SVG filter effects) are removed from the file, breaking how it looks in some browsers.

Why It Happens: WordPress's built-in security sanitization function, kses(), strips out code it deems potentially unsafe. This can sometimes include valid SVG filter elements.

Potential Solutions:

  • This is a less common issue but can be complex to resolve. The 'SVG Support' plugin allows certain filters, but if you encounter this, you may need to explore advanced custom sanitization filters or ensure your SVG code is structured as simply as possible.

General Troubleshooting Tips

  • Always Test: Before going live, test your SVGs on as many browsers and devices as you can. BrowserStack is a great tool for this.
  • Simplify Files: The more complex an SVG is, the more potential there is for rendering issues. Simplify your graphics where possible.
  • Check the Console: Your browser's JavaScript console (in Developer Tools) will often provide specific error messages that are the key to diagnosing the problem.

Most SVG display issues are related to browser-specific quirks or the SVG file itself. By methodically testing and applying these common fixes, you can usually get your graphics looking sharp everywhere.

Related Support Threads Support