<p>So the problem was caused by a secret character, the character was not visible in code but it was noticed in the w3c validator for html.</p>

<p><a href="https://i.sstatic.net/JaUxJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JaUxJ.png" alt="enter image description here"></a></p>

<p>So after removing that character issue solved.</p>

CC BY-SA 3.0
2016-09-29T17:17:28.943Z
Funny enough the whitespace character was even in your code example in your original question causing Markdown to freak out and not want to treat that line as a code block. Glad you got it sorted!
Brad Bell
CC BY-SA 3.0
2016-09-29T12:11:31.920Z
2016-09-29T12:11:31.920Z
nickGR
<p>I am getting some global entries from the CMS that I want to use as meta-tags content.</p>

<p>When I load the page I see in the inspection that the meta-tags are moved inside the body.  When I remove the dynamic meta-tags and use only the hardcoded, everything is ok.</p>

<p>I have something like that in the head:</p>

<pre><code>{% set metadata = craft.globals.getSetByHandle('metadata') %}

&lt;title&gt;{{ metadata.title }}&lt;/title&gt;
&lt;meta name="description" content="{{ metadata.description }}"&gt;
&lt;meta name="keywords" content="{{ metadata.keywords}}"&gt;
</code></pre>

<p>Why the meta-tags are moved? How can I fix that? Is it a Craft issue or a Twig issue or my mistake?</p>

CC BY-SA 3.0
2016-09-29T22:02:27.450Z
OT you can remove that `getSetByHandle` line completely as global sets get loaded automatically.
carlcs
<templating><meta>
Meta are moved to body
# Meta are moved to body

(Asked by: username_0 on 2016-09-29)

I am getting some global entries from the CMS that I want to use as meta-tags content.
When I load the page I see in the inspection that the meta-tags are moved inside the body.  When I remove the dynamic meta-tags and use only the hardcoded, everything is ok.
I have something like that in the head:
{% set metadata = craft.globals.getSetByHandle('metadata') %}

{{ metadata.title }}



Why the meta-tags are moved? How can I fix that? Is it a Craft issue or a Twig issue or my mistake?

**Tags:** templating, meta

> **Comments:**
> **username_1**: OT you can remove that `getSetByHandle` line completely as global sets get loaded automatically.  

---

## 1 answers

### Answer by username_0 on 2016-09-29. Score: 2 | Accepted answer

So the problem was caused by a secret character, the character was not visible in code but it was noticed in the w3c validator for html.

[![enter image description here](https://i.sstatic.net/JaUxJ.png)](https://i.sstatic.net/JaUxJ.png)

So after removing that character issue solved.

> **Comments:**
> **username_2**: Funny enough the whitespace character was even in your code example in your original question causing Markdown to freak out and not want to treat that line as a code block. Glad you got it sorted!  

---

