Question

I am working on Facebook share functionality and I want site description to include in meta tags so that it will display when I share info on Facebook.

Now I want to display dynamic description for different page which I need to include in meta tags and for that I need to put my dynamic code below head section.

So my question is that,will meta tags work if I put them below head section?

Was it helpful?

Solution

(Assuming that you want to use the Open Graph Protocol.)

When you are using RDFa, it’s valid to use meta elements in the body. If you don’t use RDFa (or Microdata, and possibly other extensions), it’s not valid.

This is not allowed (using name):

<body>
  <meta name="og:description" content="…" /> <!-- invalid -->
</body>

This is allowed (using property):

<body>
  <meta property="og:description" content="…" />
</body>

If you have name and property on the same meta, it should also be allowed:

<body>
  <meta name="og:description" property="og:description" content="…" />
</body>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top