Search code examples
facebook-opengraphamp-htmlaccelerated-mobile-page

Open Graph namespace declaration and Accelerated Mobile Page (AMP) Validation


I'm updating my site to AMP but by the time I try to validate I get the following error:

The attribute 'prefix' may not appear in tag 'head'

AMP validation

And the OG namespace declaration uses prefix, how can I workaround this issue?


Solution

  • Facebook sharing doesn't require the prefix attribute. So an easy workaround is to simply omit the prefix attribute. This is how ampbyexample.com does it and it still works:

    https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fampbyexample.com

    Nevertheless, the AMP validator should support the prefix attribute. I've filed an issue here.