# SVG tag does not show up in the rendered HTML

**URL:** <https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509>\
**Category:** Support\
**Created:** [December 20, 2023, 8:50pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509 "2023-12-20T20:50:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rilel](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rilel](https://community.localwp.com/u/rilel)\
**Post date:** [December 20, 2023, 8:50pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/1 "2023-12-20T20:50:14Z")

</div>

I am adding SVG tag to my custom theme, so it is pure hardcoded svg code (not a media upload).  
My code looks like this at this point (there are also css styles attached)

```auto
<div class="seven">
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 375 519">
    <defs>
      <linearGradient id="linear-gradient" x1="0" y1="259.5" x2="375" y2="259.5" gradientUnits="userSpaceOnUse">
        <stop offset=".26" stop-color="#38c2d7" />
        <stop offset=".4" stop-color="#47bfac" />
        <stop offset=".65" stop-color="#5fbd6a" />
        <stop offset=".76" stop-color="#6abe4e" />
      </linearGradient>
    </defs>
    <path class="cls-1" d="M59.5,507.5L242.5,134.5H11.5V11.5h352M126.5,507.5L331.5,72.5H63.5" />
  </svg>
</div>

```

However, the rendered page has this:

```auto
<div class="seven">
" "
</div>

```

Nothing shows up and I am not even sure where to look for this. I have a feeling that something in Local strips svg tag out. It’s not like the code is there but nothing shows up. The tag is not there at all.

* * *

### System Details

- **Local Version:** 7.1.2+6410

- **Operating System (OS) and OS version:** Windows 10 Pro

* * *

### Local Logs

local logs have no info when searching for ‘svg’

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [December 21, 2023, 2:49pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/2 "2023-12-21T14:49:35Z")

</div>

Hi @rilel

Does your theme or any plugins have cache or CSS that needs to be cleared/regenerated?

When you open up the dev console on the page do you see any errors?

---

<div class="post-metadata">

**Author:** ![rilel](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rilel](https://community.localwp.com/u/rilel)\
**Post date:** [January 3, 2024, 6:20pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/3 "2024-01-03T18:20:21Z")

</div>

CSS files are regenerated and the styles applied are there. At least I see the block with class seven and assigned styles. No other caching happens, I moved the block `.seven` to a different location on the page and it was moved but it’s still empty like so:

```auto
<div class="seven">
" "
</div>

```

No errors in the console, no issues (related to it) seen in debug.log

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [January 3, 2024, 6:42pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/4 "2024-01-03T18:42:34Z")

</div>

Some other things worth checking:

Do you have any security plugins on the site? These can sometimes block certain file types including SVGs.

Can you replicate the issue with a different theme? That would at least isolate it to something with the custom theme being an issue.

Check if there’s any CSS styling applied to the SVG that might be hiding it. Look for `display: none;` or `visibility: hidden;` in your CSS styles.

---

<div class="post-metadata">

**Author:** ![rilel](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rilel](https://community.localwp.com/u/rilel)\
**Post date:** [January 3, 2024, 6:43pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/5 "2024-01-03T18:43:57Z")

</div>

I also tried adding the simplest svg found from w3schools

```auto
<svg width="100" height="100">
  <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>

```

the code remains the same

```auto
<div class="seven">
" "
</div>

```

---

<div class="post-metadata">

**Author:** ![rilel](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rilel](https://community.localwp.com/u/rilel)\
**Post date:** [January 3, 2024, 6:55pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/6 "2024-01-03T18:55:30Z")

</div>

> [@Nick-B](#):
>
> Do you have any security plugins on the site? These can sometimes block certain file types including SVGs.

I can not test with a different theme because the page is custom post type.

I tried switching to 2020 and inserting it right after the `<header>` tag, test svgs showed up. I’ll keep looking what’s different in out theme then.  
Sorry for bothering!

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [January 3, 2024, 7:13pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/7 "2024-01-03T19:13:26Z")

</div>

Not a bother at @rilel! I was just hoping to help get you pointed in a direction. If you have any other questions or concerns don’t hesitate to reach back out. We are always happy to help!

---

<div class="post-metadata">

**Author:** ![rilel](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rilel](https://community.localwp.com/u/rilel)\
**Post date:** [January 3, 2024, 8:08pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/8 "2024-01-03T20:08:56Z")

</div>

I found the issue. Maybe it will help someone else at some point. We have wp\_kses stripping the content. That’s why svg show up in the header but not the content. Adding svg to wp\_kses\_allowed\_html helped, since it is custom theme and I’m not too worried about SVGs

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [January 3, 2024, 8:45pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/9 "2024-01-03T20:45:50Z")

</div>

Thank you for coming back and sharing that @rilel!

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [January 3, 2024, 8:45pm UTC](https://community.localwp.com/t/svg-tag-does-not-show-up-in-the-rendered-html/40509/10 "2024-01-03T20:45:55Z")

</div>

Closed on January 3, 2024, 8:45pm UTC


