Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

In order to use the "og:" meta tag of Facebook Graph, I need to add the following to the tag:


Since I am using HTML5 and not XHTML, do I still need to use the xmlns="" part?



share|improve this question

4 Answers 4

You need xmlns=" since xmlns:og and xmlns:fb are references to the xmlns - namespace. You need these because the og and fb tags are custom tags that are not part of the regular html. That is why the Validator doesn't like it if you omit it.

share|improve this answer

I haven't used Facebook Graph, but I believe those are required. They're technically only valid in xhtml, not html, but most browsers and even the validation don't care.

share|improve this answer
I tried the w3c validation on an html 5 page and w3c validation did care - it is not valid! – Perhentian Mar 2 '11 at 11:24


Once you declare <!doctype html> it's considered HTML5 thus you can omit the XHTML xmlns. I'd try to explain it but it looks like Dive Into Mark website does it spectacularly. Scroll down 'The Root Element' section.

share|improve this answer
surely then xmlns:og would not be valid... – UpTheCreek Mar 18 '11 at 7:44
Well from my understanding, you can use either syntax (HTML4.01 or XHTML) under the new doctype. You will need to validate it under an HTML"5" enabled validator like – Mike Mar 18 '11 at 17:05

Not sure how the validator feels about this but as of RDFa 1.1 you should use prefix mappings and no xmlns.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.