Pregunta

I'm trying to set the opengraph tags for a website of a holiday flat with the following headers:

<meta property="og:title" content="Hotel Test"/>
<meta property="og:type" content="hotel"/>
<meta property="og:url" content="http://dl.dropbox.com/u/256059/fb_hotel_debug/index.html"/>
<meta property="og:image" content="http://dl.dropbox.com/u/256059/random%20pictures/testen.jpg"/>
<meta property="og:description" content="Hello World!"/>
<meta property="og:latitude" content="53.554073"/>
<meta property="og:longitude" content="9.9861"/>
<meta property="og:street-address" content="ABC-Straße 19"/>
<meta property="og:locality" content="Hamburg"/>
<meta property="og:postal-code" content="20354"/>
<meta property="og:country-name" content="Germany"/>
<meta property="og:locale" content="de_DE"/>

Somehow Facebook just ignores the og:type hotel and resets it to website: http://bit.ly/wqHL1T

{
   "url": "http://dl.dropbox.com/u/256059/fb_hotel_debug/index.html",
   "type": "website",
   "title": "Hotel Test",
   "locale": {
      "locale": "de_de"
   },
   "image": [
      {
         "url": "http://dl.dropbox.com/u/256059/random\u002520pictures/testen.jpg"
      }
   ],
   "description": "Hello World!",
   "updated_time": "2012-01-30T22:45:36+0000",
   "id": "10150640100800309"
}

Am I missing something here? Because of this all the other tags like latitude and longitude are ignored...

Relevant links:
Debug page
Facebook Debugger

¿Fue útil?

Solución

Those are all deprecated tags. Please see http://ogp.me for current documentation.

Otros consejos

I encountered the same problem recently. Facebook keeps on ignoring all the meta tags.

Took me a while, but finally I used Facebook Debug Tool > "Scraped URL" to really inspect my code. This tool shows you exactly what Facebook crawler sees.

I noticed there are php errors mixed in with my HTML code. These errors never appeared in the source code for IE, FF or Chrome. In my case, it was to do with my browser detection code. Facebook's crawler's user_agent was not on my list and caused my detection code to generate error messages which broke the HTML markup. I fixed my function and everything started to work again!

I suggest you check your website with: http://developers.facebook.com/tools/debug/og/echo?q=YOUR_WEBSITE_URL_HERE

(Or use https://developers.facebook.com/tools/debug , type in your URL and press "Scraped URL" at the bottom of the page.)

Check whether there are garbage codes mixed into the <head></head> section. If there is, then Facebook will fail to parse the meta tags.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top