ImageToSVG

How to Use SVG in WordPress — Upload, Display & Troubleshoot

WordPress blocks SVG uploads by default. Learn how to safely enable SVG support, upload SVG files to your media library, and display them on pages.

Preset:
Colors:
VTracer vectorization + SVGO optimizationPrivacy protected

Enable SVG Uploads in WordPress

WordPress disables SVG uploads by default for security reasons (SVG can contain embedded JavaScript). To enable SVG uploads safely, install the Safe SVG plugin — it sanitizes SVG files on upload.

  • Install plugin: Safe SVG (WP repository, free)
  • This sanitizes SVGs on upload — removes dangerous code
  • After install, SVG appears in media library like images
  • Alternative: add SVG MIME type in functions.php (less safe)

Display SVG on WordPress Pages

After enabling SVG uploads, add SVG images via the WordPress block editor (Gutenberg) using the Image block. For inline SVG (needed for CSS control), use a Custom HTML block and paste the SVG code.

  • Image block: insert media > select SVG from library
  • Custom HTML block: paste SVG XML for inline styling
  • Use <img src='/wp-content/uploads/logo.svg'> in HTML blocks
  • For headers: add SVG via Customizer or header.php

Frequently Asked Questions

Why can't I upload SVG to WordPress?

WordPress blocks SVG by default for security. Install the Safe SVG plugin to enable SVG uploads with automatic sanitization.

Is it safe to upload SVG files to WordPress?

Only with sanitization. Install Safe SVG plugin — it strips potentially dangerous code from uploaded SVG files.

How do I make an SVG logo in WordPress?

Upload SVG via Safe SVG, then add it to your theme's header in the Customizer under Site Identity > Logo.

Can I animate SVG in WordPress?

Yes — paste the SVG inline in a Custom HTML block and add CSS animations via Additional CSS in the Customizer.

Related guides

Ready to Convert Your Image to SVG?

Free online converter — no sign-up, no watermarks, results in under 3 seconds.

Try It Free — Convert Image to SVG