How to Add an Animated SVG Logo to WordPress, Shopify or Webflow

Your SVG logo animates when opened on its own but sits still on your site? Here is how to choose the right embed method and install it on WordPress, Shopify, Webflow or Squarespace.

A common problem: the animated logo plays perfectly when you open the file in a browser, then you upload it to your site's logo field and it freezes or never appears.

The cause is usually how the file is embedded, not the animation. This guide covers the three embed methods, the steps for each platform, and the checks to run before you call it done.

Website builders change their settings often, so menu names may differ slightly on your plan or theme.

Pick your embed method first

1. Inline SVG (best choice). You paste the SVG code directly into the page. It is part of the page, so its CSS runs normally, and you can size it with your site's CSS. The trade-off is that its styles are global, which can cause the clashes covered below.

2. Object tag (good fallback). You upload the file and load it with an object tag whose type is image/svg+xml. The SVG runs as its own small document, so its styles stay separate from your site. One catch: the object can swallow clicks, so a logo that links home may stop working. Adding this rule to the object fixes it:

pointer-events: none;

3. Image tag or logo upload field (least reliable). Most theme logo fields output an image tag. Scripts inside the SVG never run this way. CSS animation inside the file may play in some browsers, but there are WebKit bug reports of it sticking on the first frame in Safari. Only use this method if you have tested it on a real iPhone and a Mac. CSS background images have the same limits.

Rule of thumb: use inline if your platform lets you edit the header, the object tag if you can add HTML but want the file kept separate, and the logo field only as a last resort.

Prepare the file before pasting

Do these once, and every platform below gets easier.

  1. Check for a viewBox. Open the SVG in a text editor and look for viewBox in the opening svg tag. Without it, the logo will not scale properly.
  2. Convert live text to outlines. Text that relies on a font can display wrongly if that font is missing. Outline it in your vector editor first.
  3. Give the svg element its own class, such as lm-logo. The CSS below depends on it.
  4. Rename generic classes. Illustrator exports often use names like .cls-1 or .st0. Once inlined, styles are global, so two SVGs using .cls-1 will overwrite each other. Find and replace them with something unique, such as .lm-a and .lm-b.
  5. Make IDs unique. Gradients, masks and clip paths are referenced by ID, so a duplicate ID can make part of the logo vanish.
  6. Remove any script tags. A logo doesn't need them, and many platforms strip them anyway.
  7. Add an accessible name. On the svg element, add role="img" and aria-label="Your Company home".
  8. Set a size. This keeps the logo from collapsing or filling the header:

.lm-logo { display: block; width: 160px; height: auto; max-width: 100%; }

  1. Add a reduced-motion rule. Some visitors ask their devices to limit motion:

@media (prefers-reduced-motion: reduce) { .lm-logo, .lm-logo * { animation: none !important; } }

That rule only works if the logo's normal CSS is its finished, visible state, with the hidden starting point set only in the keyframes (the from step). If your default CSS hides the logo and the animation reveals it, reduced-motion visitors get a blank header. Writing it this way also means the logo still shows if the animation fails to run.

WordPress

WordPress blocks SVG uploads by default, but pasting inline code avoids the upload entirely.

Block themes (Site Editor):

  1. Go to Appearance, then Editor, and open the Header template part.
  2. Add a Custom HTML block next to the Site Logo block.
  3. Paste your SVG code and wrap it in a link to your homepage.
  4. Save, check the live site, then remove the Site Logo block.

Classic themes and header builders:

  1. See whether your theme's header builder has an HTML element. Many do. If so, paste the code there.
  2. If not, use a child theme and put the code in header.php where the logo is output. Editing the parent theme directly means an update can erase your work.

WordPress gotchas:

Shopify

Back up first: in Online Store, then Themes, duplicate your live theme and work on the copy.

  1. Open the copy and choose Edit code.
  2. Under Snippets, add a new snippet called animated-logo and paste in your SVG code.
  3. Find the logo markup. In many themes it is in sections/header.liquid, but file names vary. Searching the theme for settings.logo usually finds it.
  4. Inside the existing link to your homepage, replace the logo image markup with:

{% render 'animated-logo' %}

  1. Some themes output the logo more than once, so check for a second instance, such as a mobile or sticky version.
  2. Preview the copy, then publish it.

Custom code may not carry over when you update your theme, so recheck the logo after any update.

Webflow

  1. In the Designer, open your Navbar and select the Brand link.
  2. Remove the Image element inside it.
  3. Add a Code Embed element in its place and paste your SVG code.
  4. Publish and test on the live site, since the Designer canvas may not show the animation accurately.

Check your plan's custom code access and the Code Embed character limit. Complex logo exports can be very long, so simplify the paths or use the object tag method if yours won't fit. Avoid Webflow's Image element here, because it brings back the image tag limits above.

Squarespace

Squarespace is the trickiest of the four. Guides disagree on whether its logo field accepts SVG, so try it on your own site rather than trusting a blanket answer.

For a logo inside a page section, such as a hero, add a Code Block, paste the SVG code and save. Check that your plan includes code blocks.

For the site header, you generally can't drop a Code Block in. The usual workaround is to upload the SVG as a custom file in the Custom CSS panel and set it as a background image. On many 7.1 sites the CSS looks like this, but use your browser's inspector to confirm the class name:

.header-title-logo img { opacity: 0; } .header-title-logo a { background: url(YOUR-FILE-ADDRESS) left center / contain no-repeat; }

Keep a normal logo uploaded underneath so the link and layout still work. Because this is a background image, the Safari caveat applies, so test it on an Apple device.

Avoid these header mistakes

Final test checklist

Test the live, published page in a private window after clearing any site cache.

If the logo still won't animate, open the SVG file directly in a browser. If it plays there, the embed method is the problem, so move one step up the list: logo field to object tag, or object tag to inline. If it doesn't play there, the problem is in the file's CSS or paths.

Want the full done-for-you kit?
LoopMark Studio: Your Animated SVG Logo, Done For You (CSS Draw-On, No JavaScript, 48-Hour ยท $39.00
Get it on Gumroad