Jump to content

why doesnt my meta tags have effect on facebook?


rain13

Recommended Posts

Hello.I am trying to specify title, description and image for facebook but my meta tags doesnt work. Any ideas?

<!DOCTYPE html><html xmlns:og="http://ogp.me/ns#"><head><title>My site</title><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><meta name="title" property="og:title" content="Sample Title" /><meta property="og:description" content="Sample description"><meta name="image" property="og:image" content="http://yourshot.nationalgeographic.com/u/fQYSUbVfts-T7pS2VP2wnKyN8wxywmXtY0-Fwsgxpi9nxv4XgGwfeKJsnYs5NUij4X_IUIoAtrPnX5kIWmikYF2fp9MR1wTT8DH1JuGe8-qJ4ViHJFrUagMIMF1Fwhe5fbvmiGNAeW2Xike1jpziMjSlaHgOb0zmJoVaIURenAHffRuupC4qC0yZ0BDe54LdFPEmracDkoMviXxV/" /><!--main.html--></head><body>content</body></html>
Link to comment
Share on other sites

Well according to the w3c validator:Validation Output: 3 Errors

  • [*]error.png
Line 2, Column 35: Attribute xmlns:og not allowed here.<html xmlns:og="http://ogp.me/ns#">[*]warning.pngLine 2, Column 35: Attribute with the local name xmlns:og is not serializable as XML 1.0.<html xmlns:og="http://ogp.me/ns#">[*]error.pngLine 6, Column 64: Bad value title for attribute name on element meta: Keyword title is not registered.<meta name="title" property="og:title" content="Sample Title" />Syntax of metadata name:A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself. [*]error.pngLine 8, Column 302: Bad value image for attribute name on element meta: Keyword image is not registered.…SlaHgOb0zmJoVaIURenAHffRuupC4qC0yZ0BDe54LdFPEmracDkoMviXxV/" /><!--main.html-->Syntax of metadata name:A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself.

what it should look like is:

<!DOCTYPE html><html><head><title>My site</title><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><meta property="description" content="Sample description"><!--main.html--></head><body>content<img src="http://yourshot.nationalgeographic.com/u/fQYSUbVfts-T7pS2VP2wnKyN8wxywmXtY0-Fwsgxpi9nxv4XgGwfeKJsnYs5NUij4X_IUIoAtrPnX5kIWmikYF2fp9MR1wTT8DH1JuGe8-qJ4ViHJFrUagMIMF1Fwhe5fbvmiGNAeW2Xike1jpziMjSlaHgOb0zmJoVaIURenAHffRuupC4qC0yZ0BDe54LdFPEmracDkoMviXxV/" alt="" ></body></html>

Link to comment
Share on other sites

Those og: meta tags are required for facebook likes

 

For old Transitional doctype to make og validate you would place these facebook meta tags within html comment.

<!--<meta name="title" property="og:title" content="Sample Title" /><meta property="og:description" content="Sample description"><meta name="image" property="og:image" content="http://yourshot.nationalgeographic.com/u/fQYSUbVfts-T7pS2VP2wnKyN8wxywmXtY0-Fwsgxpi9nxv4XgGwfeKJsnYs5NUij4X_IUIoAtrPnX5kIWmikYF2fp9MR1wTT8DH1JuGe8-qJ4ViHJFrUagMIMF1Fwhe5fbvmiGNAeW2Xike1jpziMjSlaHgOb0zmJoVaIURenAHffRuupC4qC0yZ0BDe54LdFPEmracDkoMviXxV/" />-->

Facebook will still read these, but when you validate it would be ignored and pass.

 

So if it works for Transitional, might be option for HTML5 doctype.

Link to comment
Share on other sites

Thanks.Could anyone look at og tags http://autoit.net.ee/pub/?p=241 and tell me why it doesn't display large image?I want it to look like:ABC-News-600x471.png

 

If I share my photo it looks small :(However the image linked in meta tags is large enough...Notice: You don't have to actually share it to see the preview, you can hit cancel at preview.

Edited by SoItBegins
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...