为什么 facebook 不使用 og:title 标签?

发布于 2024-12-25 14:08:40 字数 416 浏览 1 评论 0原文

非常令人沮丧的是

,我已经定义了两个标签,默认的 html 标签:

<title>Default title</title>

另外,还有 opengraph 标签:

<meta property="og:title" content="Facebook custom title"/>

但是 facebook 仍然从常规标题标签中提取标题...

可以看到/测试 这里

我不认为这是 facebook 缓存问题,因为我首先添加了 og 标签,然后尝试分享它...

知道我错过了什么吗?

its very frustrating

i have defined both tags, the default html one:

<title>Default title</title>

And aditionally, the opengraph one:

<meta property="og:title" content="Facebook custom title"/>

But facebook stills pulling the title from the regular title tag...

Can be seen/tested here

I don't think its a facebook caché issue because i first add the og tag and then tried to share it...

Any idea what am I missing?

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

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

发布评论

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

评论(2

絕版丫頭 2025-01-01 14:08:40

调试器说你的属性被推断出来,这意味着他无法从你的元数据中获取它们。其原因可能是无效标记。尝试将每个 og 元标记放在不同的行中,并尝试在关闭之前放置一个空格 />对于有效的 XHTML

<meta property="og:title" content="Meliá - January Super Sales" />
<meta property="og:site_name" content="Meliá - January Super Sales" />
<meta property="og:description" content="Meliá - January Super Sales" />
<meta property="og:image" content="http://d2p65vgzoeytng.cloudfront.net/nPromociones/producto/januarySupersale/img/icoPromoCompartirFacebook.gif" />

等,

我不确定,但这可能有效。

debugger says your properties are inferred, that means that he was'n able to fetch them from your og metas. the reason for this may be invalid markup. try to place each of your og meta tags in different line and try to place a space before closing /> for valid XHTML

<meta property="og:title" content="Meliá - January Super Sales" />
<meta property="og:site_name" content="Meliá - January Super Sales" />
<meta property="og:description" content="Meliá - January Super Sales" />
<meta property="og:image" content="http://d2p65vgzoeytng.cloudfront.net/nPromociones/producto/januarySupersale/img/icoPromoCompartirFacebook.gif" />

and etc.

i'm not sure, but this may work.

鸢与 2025-01-01 14:08:40

元标记对我来说是正确的,并且当我使用 netcat 运行虚拟 Web 服务器时,如果我转储来自服务器的 HTTP 响应并将其作为对调试器的响应,它们在调试器中工作正常。

但如果你看看 Facebook 抓取工具从您的网站获取看到开放图元标签消失了。如果我使用虚拟网络服务器对您网站的响应执行相同的操作,它们就会出现。

您的网站是否有条件地以某种方式输出开放图元标记,或者它们始终包含在内?

我做了什么:

$ nc -l -p 8000 > fbrequest

在 Facebook 调试器中调试 http://myhost:8000 并转储请求

$ vim fbrequest

将请求路径更改为 /nPromociones/producto/januarySupersale/jsp/C_Home.jsp?staticDomain=false 和主机头到 es.solmelia.com

$ cat fbrequest | nc es.solmelia.com 80 > solmelia

制作虚假的 Facebook scraper 请求并转储响应

$ cat solmelia | nc -l -p 8000

在 Facebook 中调试 http://myhost:8000再次调试器,它将显示元标记出现并且是正确的。

The meta tags seams correct to me and they work fine in the debugger if I dump the HTTP response from your server and give it as response to the debugger when I run a dummy web server with netcat.

But if you take a look what the Facebook scraper get from your site you see that the open graph meta tags are gone. If I do the same with the response from your site using a dummy web server they appear.

Do your site conditionally output the open graph meta tags somehow or are they always included?

What I did:

$ nc -l -p 8000 > fbrequest

Debug http://myhost:8000 in Facebook debugger and dump request

$ vim fbrequest

Change request path to /nPromociones/producto/januarySupersale/jsp/C_Home.jsp?staticDomain=false and host header to es.solmelia.com

$ cat fbrequest | nc es.solmelia.com 80 > solmelia

Make fake Facebook scraper request and dump response

$ cat solmelia | nc -l -p 8000

Debug http://myhost:8000 in Facebook debugger again and it will show that the meta tags appear and are correct.

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