Facebook open graph meta tags maximum content leng

2019-03-11 14:31发布

问题:

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.