I understand that open graph should be embedded on the page like the following:
(as per this link: http://http://ogp.me/)

<meta property="og:title" content="The Rock" />
<meta property="og:type" content="movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />

However, the above is invalid HTML5. HTML5 requires a name/content attributes. OG on the other hand uses the property/content attributes.

This problem has caused W3C to return validation errors on the site.

Is it correct to just use the "name" attribute in Metatag Open Graph module? I can submit a path for this and seems to work - w3c validates it okay. I'm not sure if this is okay with OG.

Thanks. Tim


DamienMcKenna’s picture

Version: 7.x-1.0-beta7 » 7.x-1.x-dev
Priority: Major » Normal
Status: Needs review » Active

The Open Graph standards dictate how they should work, but I'm not opposed to improving the output if needed. What validator are you using?

FYI, please leave new tickets in "open" status unless you happen to upload a patch, in which case set it to "needs review"; also, support requests should be marked as "normal" priority. Thanks :)

timhtheos’s picture

Hello Damien,

Noted. The validator I am using is W3 validator and also the NU markup validation service of W3.



DamienMcKenna’s picture

I don't get this error when I validate my site with the Nu validator:


(yes, there are a bunch of other errors, but nothing related to OG)

What base theme are you using? Did you override the html.tpl.php file?

kingfisher64’s picture

Issue summary: View changes

I believe this not being incorrectly set in metatag module as I have Adaptive Theme and it appears that they are set in there.

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

I think this missing part is that the site should have prefix="og: http://ogp.me/ns#" in the root HTML tag. Metatag attempts to add this attribute automatically, but if themes are bypassing normal Drupal preprocessing or ignoring those attributes, then there's not much we can do.

It would help to have:
- The theme name and version of that theme you are using.

Michael_Lessard_micles.biz’s picture

I found the answer here :

Open Graph requires a top «HTML» code with or without HTML5.

HTML 5 :

<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">

( note: this is placed at the very very top above the headers in your theme main page.
The fb part is for other Facebook tricks other than Open Graph, but might as well insert it just in case.)

<html xmlns:og="http://opengraphprotocol.org/schema/" xmlns="http://www.w3.org/1999/xhtml">
( note that the xmlns part can vary depending on your Drupal version, theme, etc.)

PS : therefore the Metatag module instructions (ReadMe) need to add this for Open Graph to really work. It didn't work well for me without. I also had to turn off another Open Graph Drupal module to avoid duplicates.

timhtheos’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)