Facebook open graph meta tags maximum content length

懵懂的女人 提交于 2019-12-31 10:19:05

问题


Does anyone know the maximum valid length for each of Facebook's open graph meta tags?

The description of the meta tags on http://ogp.me/ does not list maximum lengths, only general descriptions such as "A one to two sentence description of your object" for the og:description meta tag.

From what I understand, there is no maximum content length for meta tags in general, just recommendations to keep them under certain lengths for SEO reasons.

I'd be curious to know if there is a hard limit and what the limits are for what is visible on a link posted to Facebook.


回答1:


There isn't a hard limit on the data you can put there, but in various rendering places Facebook will limit it. The limit in news feed is different from the limit in Ticker which is different than the limit on timeline.

Just put the correct content in there and we'll truncate it when rendering.




回答2:


Here's a good link regarding this topic: http://www.joshspeters.com/how-to-optimize-the-ogdescription-tag-for-search-and-social

Regarding Facebook it says:

"Right now Facebook only displays the first 300 characters of a description so if your primary audience is on Facebook write your OG:Description tag accordingly."




回答3:


In my testing:

og:title 40 chars

og:description has 2 max lengths:
When the link is used in a Post, it's 300 chars. When a link is used in a Comment, it's 110 chars.

So you can either treat it as 110, or, write your Descriptions to 300 but make sure the first 110 is the critical part and still makes sense when it gets cut off.



来源:https://stackoverflow.com/questions/8914476/facebook-open-graph-meta-tags-maximum-content-length

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!