Using SVG on WordPress — enabling uploads safely, converting PNG assets, and performance gains.

WordPress doesn't allow SVG uploads by default due to security concerns, but SVG offers significant advantages for WordPress sites: faster loading, Retina-sharp graphics, and smaller file sizes for logos and icons.

Why Use SVG on WordPress?

PNG logos and icons are the biggest missed optimization on most WordPress sites. A PNG logo might be 50KB; the SVG equivalent is often 3-5KB and looks sharper on every screen. Multiply that by every page load and visitor.

Enabling SVG Uploads

Install the Safe SVG plugin (by 10up) from the WordPress plugin repository. It sanitizes uploaded SVGs to prevent security issues while allowing them in your media library. Alternatively, use the SVG Support plugin.

Converting Your Assets

  1. Identify PNG assets that should be SVG: logo, favicon, icons, decorative illustrations
  2. Convert each PNG to SVG free using Shape to Vector
  3. Optimize with SVGOMG for minimum file size
  4. Upload to WordPress via Media → Add New
  5. Replace PNG references in your theme with the new SVG files

Security Note

Always sanitize SVGs before uploading (Safe SVG plugin handles this). SVG is XML and can theoretically contain malicious scripts. Never upload SVGs from untrusted sources without sanitization.