w3c validator shows error for facebook open graph
Asked Answered
A

1

2

I get 2 errors while validating my site in w3c validator.

Line 7, Column 47: Attribute xmlns:og not allowed here. xmlns:fb="http://www.facebook.com/2008/fbml" >

Line 7, Column 47: Attribute with the local name xmlns:fb is not serializable as XML 1.0. xmlns:fb="http://www.facebook.com/2008/fbml" >

I guess it is related with Facebook open graph. I'm running my site on wordpress and using All in one SEO pack with Social features enabled. When Social feature is disabled, my site validates perfectly with no errors. Is there any fix to this problem? This is how it looks on site

<!DOCTYPE html>

<!--// OPEN HTML //-->
<html lang="en-US"
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:og="http://ogp.me/ns#" 
    xmlns:fb="http://www.facebook.com/2008/fbml" >

    <!--// OPEN HEAD //-->
    <head>

        <!--// SITE TITLE //-->
        <title>Aton usluge | Licencirana agencija za kreditno posredovanje</title>


        <!--// SITE META //-->
        <meta charset="UTF-8" />    
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">

and so on..

Ailsa answered 28/4, 2014 at 11:19 Comment(0)
G
5

The xmlns attribute is deprecated in HTML+RDFa 1.1.

You should use the prefix attribute instead:

<html 
  prefix="og: http://ogp.me/ns# 
          fb: http://www.facebook.com/2008/fbml">

resp. if you want to keep the xmlns for XHTML5:

<html 
  xmlns="http://www.w3.org/1999/xhtml"
  prefix="og: http://ogp.me/ns# 
          fb: http://www.facebook.com/2008/fbml">
Gomphosis answered 29/4, 2014 at 15:45 Comment(1)
I'll try that, as soon as I figure out how to implement that since All in one SEO inserts that attribute automaticaly. Guess I should edit plugin files to get it done right. ThanksAilsa

© 2022 - 2024 — McMap. All rights reserved.