Lorixen.
EN

SVG Logos and Icons on a Business Website

Short answer: Use SVG for your logo and simple icons: it stays sharp on every screen, is usually tiny, and can change colour with CSS. Ask your designer for a cleaned-up "web SVG", give it an accessible name, and keep PNG versions for places that don't handle SVG well, such as social link previews and email signatures. On WordPress, SVG uploads are blocked by default, so add them through a plugin or theme that sanitizes the file.

What SVG is, in plain terms

A JPG or PNG is a grid of coloured pixels. Stretch it on a large monitor or a high-density phone screen and the edges go soft. SVG (Scalable Vector Graphics) works differently: MDN describes it as an XML-based, text-based format that describes shapes, so the browser redraws it cleanly at any size.

For a logo, that's exactly what you want. The same file looks crisp in a 40-pixel-high header on a phone and on a 4K monitor in your shop window display. Because it's text, a simple logo is often a few kilobytes, smaller than an equivalent PNG.

Photos are a different story. SVG is for flat shapes, lines and type. A product photo or a team portrait stays a JPG, WebP or AVIF.

Getting a clean SVG from your designer

Design software exports SVGs full of leftovers: hidden layers, editor metadata, embedded bitmap images, fonts that may not load. When you brief a designer, ask for:

  • Text converted to outlines. Otherwise the logo depends on a font the visitor may not have.
  • No embedded raster images. An SVG wrapping a PNG gains nothing.
  • A tidy viewBox and no fixed width/height, so the site can size it with CSS.
  • Separate versions: full-colour, one-colour (black), reversed (white), and a square icon or monogram.
  • A matching PNG set at a few sizes for places SVG won't go.

Open the file in a text editor. If it's hundreds of lines for a simple wordmark, ask for an optimized export.

Three ways to put SVG on a page

As an image

<img src="logo.svg" alt="Maple & Pine Bakery"> is the simplest option. It's cached like any image, can't be styled from your page's CSS, and the alt attribute gives it an accessible name. MDN's guide on SVG in HTML confirms that alt provides the alternative text when SVG is used through <img>.

Best for: logos that never change colour, and any SVG you didn't create yourself.

Inline in the HTML

Pasting the SVG code straight into the page means CSS can change its colour on hover or in dark mode, and you save a network request. The trade-offs: it isn't cached separately, and it bloats every page it appears on if it's large.

Inline SVG doesn't take an alt attribute. MDN recommends adding role="img" so assistive technology treats it as an image, and a <title> element as the first child of the <svg> to give it a short accessible name. If visible text already describes the graphic, MDN suggests referencing it with aria-labelledby instead.

Best for: small interface icons (search, menu, phone, cart) that need to match your colour scheme.

As a CSS background

Fine for purely decorative shapes. Never use it for the logo or meaningful icons, because a background image has no accessible name at all.

Accessibility in one paragraph

Name what matters, hide what doesn't. Your logo needs a name, usually the business name (not "logo"). An icon inside a button that already says "Call us" is decorative, so hide it from screen readers with aria-hidden="true" and let the button text do the work. An icon-only button, like a magnifying glass, needs an accessible name on the button itself.

WordPress: why your SVG upload fails

If WordPress says "Sorry, you are not allowed to upload this file type", that's expected. The core list of allowed upload types in wp_get_mime_types() covers formats like JPEG, PNG, WebP, AVIF and ICO, but not SVG (as of November 2026).

The reason is safety. SVG is code, and MDN notes it's designed to work with JavaScript. A malicious SVG uploaded by any user with media access could carry script. Your options:

  • A plugin that sanitizes SVG on upload and limits uploads to administrators. Choose one that is actively maintained.
  • Your theme's logo setting, if it supports SVG and handles sanitizing.
  • Inline the logo in the theme's header template, done by a developer, so no upload is needed.

Avoid snippets that simply add svg to the allowed types without any sanitizing. They solve the error message and open the security hole.

SVG as a favicon

Browsers that support SVG favicons keep them sharp in tabs, and a media query inside the file can even switch colours for dark mode. Keep a fallback: a favicon.ico or PNG alongside it. MDN's documentation on rel="icon" explains that when there are several icon links, the browser picks using their media, type and sizes attributes, and moves to the next one if a format turns out to be unsupported, so declare the SVG with type="image/svg+xml". MDN also notes that Apple's iOS doesn't use this link type to pick a home-screen icon, so a PNG touch icon is still worth having.

Where PNG is still the better choice

  • Social link previews. The Open Graph protocol lets you declare an image's MIME type, but the platforms decide what they render. Use a JPG or PNG for og:image.
  • Email signatures and newsletters. Email clients are inconsistent with SVG. Send a PNG at twice the display size.
  • Uploads to third-party platforms such as Google Business Profile, booking tools and marketplace listings, which typically ask for JPG or PNG. Check each platform's own upload guidance.
  • Documents and printing partners, who may ask for PDF or EPS instead.

A quick checklist

  1. Clean web SVG with outlined text and a viewBox.
  2. <img> with descriptive alt for the logo, or inline with role="img" and <title>.
  3. Decorative icons hidden from screen readers.
  4. SVG uploads only through a sanitizing method.
  5. PNG copies for social, email and third-party profiles.
  6. SVG favicon with an ICO or PNG fallback.

FAQ

Is SVG better for SEO than PNG?

Not directly. Search engines care about page speed, alt text and context. SVG can help speed by being small, but a well-compressed PNG logo won't hurt rankings.

Can I use an SVG of a detailed illustration?

You can, but complex artwork can produce large files that are slower to draw than a WebP. Compare file sizes before deciding.

Why does my SVG logo look huge or tiny?

Usually it's missing a viewBox or has fixed dimensions. Ask for a re-export or set the width in CSS.

Do I need a different file for dark mode?

Either a reversed version, or an inline SVG coloured with currentColor so it follows the text colour.

Want your logo set up properly across the header, favicon and social previews? Send us the files you have and we'll tell you what's missing.

Sources

WhatsAppLet’s talk