为什么 facebook 不使用 og:title 标签?
非常令人沮丧的是
,我已经定义了两个标签,默认的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
调试器说你的属性被推断出来,这意味着他无法从你的元数据中获取它们。其原因可能是无效标记。尝试将每个 og 元标记放在不同的行中,并尝试在关闭之前放置一个空格 />对于有效的 XHTML
等,
我不确定,但这可能有效。
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
and etc.
i'm not sure, but this may work.
元标记对我来说是正确的,并且当我使用 netcat 运行虚拟 Web 服务器时,如果我转储来自服务器的 HTTP 响应并将其作为对调试器的响应,它们在调试器中工作正常。
但如果你看看 Facebook 抓取工具从您的网站获取看到开放图元标签消失了。如果我使用虚拟网络服务器对您网站的响应执行相同的操作,它们就会出现。
您的网站是否有条件地以某种方式输出开放图元标记,或者它们始终包含在内?
我做了什么:
在 Facebook 调试器中调试
http://myhost:8000
并转储请求将请求路径更改为
/nPromociones/producto/januarySupersale/jsp/C_Home.jsp?staticDomain=false 和主机头到
es.solmelia.com
制作虚假的 Facebook scraper 请求并转储响应
在 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:
Debug
http://myhost:8000
in Facebook debugger and dump requestChange request path to
/nPromociones/producto/januarySupersale/jsp/C_Home.jsp?staticDomain=false
and host header toes.solmelia.com
Make fake Facebook scraper request and dump response
Debug
http://myhost:8000
in Facebook debugger again and it will show that the meta tags appear and are correct.