分享网址链接在 Facebook 上不显示缩略图

发布于 2024-12-26 03:38:11 字数 574 浏览 4 评论 0原文

我有一些提供 Facebook 共享的示例网址。但 url 页面内的图像不会显示在 Facebook 评论框中。我已经插入了像这样的元标记

<meta property="fb:app_id" content="xxxx"/>
<meta property="og:site_name" content="xxxx"/>
<meta property="og:title" content="xxxx" />
<meta property="og:description" content="xxx" />
<meta property="og:type" content="xxx:photo">
<meta property="og:url" content="http://www.example.com/content/xxx"/>
<meta property="og:image" content="http://www.example.com/images/xxx.png"/>

*并且我的图像是1000*1000 px(宽度*高度)。

有解决办法吗?

I have some example url that provide for facebook sharing. But the image inside the url page does not show on facebook comment box. I have already inserted Meta tag like this

<meta property="fb:app_id" content="xxxx"/>
<meta property="og:site_name" content="xxxx"/>
<meta property="og:title" content="xxxx" />
<meta property="og:description" content="xxx" />
<meta property="og:type" content="xxx:photo">
<meta property="og:url" content="http://www.example.com/content/xxx"/>
<meta property="og:image" content="http://www.example.com/images/xxx.png"/>

*And my image is 1000*1000 px(width*height).

Any idea for solve?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

三岁铭 2025-01-02 03:38:11

您的元标记应如下所示:

<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>

并且必须将其放置在您要共享的页面上(这在您的问题中不清楚)。

如果您在图像(或元标记)出现之前共享了该页面,那么 facebook 的“内存”中可能会存在没有图像的页面。在这种情况下,只需在调试工具中输入页面的 URL http://developers.facebook.com/tools /调试。之后,下次共享页面时应该会出现该图像。

Your meta tag should look like this:

<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>

And it has to be placed on the page you want to share (this is unclear in your question).

If you have shared the page before the image (or the meta tag) was present, then it is possible, that facebook has the page in its "memory" without an image. In this case simply enter the URL of your page in the debug tool http://developers.facebook.com/tools/debug. After that, the image should be present when the page is shared the next time.

半世晨晓 2025-01-02 03:38:11

问题出在 facebook 缓存上,解决方案是通过访问链接刷新 facebook 缓存。
https://developers.facebook.com/tools/debug/og/object/

并按下按钮“获取新的抓取信息”。

希望有帮助

The issue is with the facebook cache and solution is to refresh the facebook cache by going to the link.
https://developers.facebook.com/tools/debug/og/object/

and pressing the button "Fetch New Scrape information".

Hope it helps

入画浅相思 2025-01-02 03:38:11

我发现您使用 og:image 指定的图像实际上必须出现在图像标记内的 HTML 页面中。

仅在我为图像添加图像标签后,缩略图才出现。它被注释掉了。但有效。

I found out that the image that you are specify with the og:image, has to actually be present in the HTML page inside an image tag.

the thumbnail appeared for me only after i added an image tag for the image. it was commented out. but worked.

美胚控场 2025-01-02 03:38:11

我的网站也面临同样的问题。

使用 Facebook 调试工具根本没有帮助。获取新数据但不获取图像缓存。

我通过添加 www.facebook 来强制清除图像缓存。进入图像网址。在您的情况下,删除 www.并配置 Web 服务器重定向。

 add/remove www. in image url should solve the problem

My site faces same issue too.

Using Facebook debug tool is no help at all. Fetch new data but not IMAGE CACHE.

I forced facebook to clear IMAGE CACHE by add www. into image url. In your case is remove www. and config web server redirect.

 add/remove www. in image url should solve the problem
日久见人心 2025-01-02 03:38:11

上面的答案很好,它们应该可以解决您遇到的大部分问题。
但要直接从 Facebook 查看错误,您可以使用链接 https://developers.facebook。 com/tools/debug/sharing/

这样您就可以确定需要采取的步骤。

我发现 og:image 元的 URL 必须是绝对 URL

The answers above are good and they should fix most of the problems you have.
But to see the errors directly from facebook you can use the link https://developers.facebook.com/tools/debug/sharing/

that way you're sure of the steps you need to take.

I found out the URL for the og:image meta has to be an absolute url

梦在深巷 2025-01-02 03:38:11

我遇到了这个问题,虽然我有 og:image (和其他),但我缺少 og:url 和 og:type,所以我添加了它们,然后它就工作了。

<meta property="og:url" content="<? 
 $url = 'https://' . $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];; 
echo htmlentities($url,ENT_QUOTES); ?>"/> 

I ran into this and while I had the og:image (and others), I was missing og:url and og:type, so I added those and then it worked.

<meta property="og:url" content="<? 
 $url = 'https://' . $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];; 
echo htmlentities($url,ENT_QUOTES); ?>"/> 

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文