Why is Facebook not reading OG tags?

I have all open graph tags rendered properly in my web page even though Facebook wasn’t reading those OG tags.  I used Facebook debugger tool to see what Facebook sees exactly when it scrapes my web page.  I got the message saying that HTML is malformed and thus Facebook pulls the information that it needs from page using it’s own algorithm even though OG tags are in page.  Here is the warning message I see when using Facebook debugger tool.

Your page has meta tags in the body instead of the head. This may be because your HTML was malformed and they fell lower in the parse tree.  Please fix this in order for the tags to be usable.

I have looked into HTML to figure out what exactly malformed HTML causing this problem.  I had <noscript> in <head> tag which is invalid in HTML 4 that was the culprit.  I did move noscript element within body tag and it worked fine.  Good thing is that you can have noscript element in Head tag if you are using HTML 5 so Facebook should have no issue if you are using HTML 5.

Hope this helps.

Posted in Microsoft Technology Tagged with: ,