Html 无法修复:应该明确提供“og:image”属性,即使可以从其他标签推断出一个值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41553304/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 14:13:37  来源:igfitidea点击:

Can't fix: 'og:image' property should be explicitly provided, even if a value can be inferred from other tags

htmlfacebookwebwixcode

提问by Kevin Bright

I have a website that triggers a warning when clicked through a link shared on facebook. The warning says: "Possible problem with this link We have detected that this link: http://www.sjap.online/may be malicious. To keep your account and device secure, only follow links you trust."

我有一个网站,当点击 Facebook 上共享的链接时会触发警告。警告说:“此链接可能存在问题我们检测到此链接:http: //www.sjap.online/可能是恶意的。为了确保您的帐户和设备安全,请仅访问您信任的链接。”

I ran the facebook debug tool and I get the following error message:

我运行了 facebook 调试工具,但收到以下错误消息:

Inferred Property
The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.

Inferred Property
The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.

I googled this issue and I understand it is caused by some lack of meta information in the site header, but my site's code has the following in the header:

我在 google 上搜索了这个问题,我知道这是由于站点标题中缺少元信息引起的,但是我站点的代码在标题中包含以下内容:

<meta http-equiv="etag" content="2efdc27c8967f14e2c829e601f7a1228"/>
<meta property="og:title" content="South Jersey Aerial Photograpahy"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://www.sjap.online/"/>
<meta property="og:image" content="https://static.wixstatic.com/media/56a444_9273e80a60684dc8b38e56025059f356%7Emv2_d_3200_1800_s_2.png"/>
<meta property="og:site_name" content="South Jersey Aerial Photograpahy"/>
<meta property="og:description" content="South Jersey Aerial Photography is South Jersey's premier aerial photography and aerial videography company. Fully licensed and insured. Contact us today!"/>
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE"/>

I have no idea how to fix this error message. The property metatag is clearly there.

我不知道如何修复此错误消息。属性元标记显然在那里。

回答by Oleg Cherr

UPD Apr 2020: The link below doesn't work anymore :( Still looking for a solution...

UPD 2020 年 4 月:以下链接不再有效:​​( 仍在寻找解决方案...

In short, you should re-fetch your website information using this tool: https://developers.facebook.com/tools/debug/og/object/

简而言之,您应该使用此工具重新获取您的网站信息:https: //developers.facebook.com/tools/debug/og/object/

Sharing Debuggeronly retrieves the information about your site from the Facebook cache.

共享调试器仅从Facebook 缓存中检索有关您网站的信息。

More details here: https://stackoverflow.com/a/44453472/4899346

更多细节在这里:https: //stackoverflow.com/a/44453472/4899346

回答by Alex C

Following the already mentioned link to the Facebook object debugger, make sure that your og tags are written RIGHT AFTER the opening <head>tag.

按照已经提到的Facebook 对象调试器链接,确保您的 og 标签是在开始<head>标签之后写入的。

Not sure why this happens but I used to run into the exact same issue until I moved them right after it and then clicked once again on "Fetch new scrape information".

不知道为什么会发生这种情况,但我曾经遇到过完全相同的问题,直到我在它之后立即移动它们,然后再次单击“ Fetch new scrape information”。

Hope this helps!

希望这可以帮助!

回答by Sebastian

Ran into the same issue today. It would appear that it's a bug on Facebook's end.

今天遇到了同样的问题。这似乎是 Facebook 端的一个错误。

Justby refreshing the Sharing Debuggerwill show me different error messages after each reload, including "Image Too Big", which clearly was not the case, and "Meta Tags In Body" which also was not correct.

只需刷新共享调试器就会在每次重新加载后向我显示不同的错误消息,包括“图像太大”,这显然不是这种情况,以及“正文中的元标记”也不正确。

As long as the correct image shows up in the Link Preview, I think you're good to go.

只要链接预览中显示正确的图像,我认为您就可以开始了。

回答by zainul ogna

Check for og:urltag and see whether the url is correct or not. In my case the url was not correct and so it was causing this type of error.

检查og:url标签并查看网址是否正确。就我而言,网址不正确,因此导致了此类错误。

回答by aditya dixit

Had same issue today

今天有同样的问题

'og:image' property should be explicitly provided, even if a value can be inferred from other tags

'og:image' 属性应该明确提供,即使可以从其他标签推断出一个值

somehow my linter replaced "(quotation mark)to ”(right double quotation mark), therefore https://developers.facebook.com/tools/debug/sharing/was showing issue,

不知何故,我的 linter 将“(引号)替换为”(右双引号),因此https://developers.facebook.com/tools/debug/sharing/出现问题,

cause of that, these meta properties were not visible to fb-bot. After this correction it works fine

因此,这些元属性对 fb-bot 不可见。在此更正后,它工作正常

回答by Rafik Bari

If you're using a plugin like W3 Total Cache, Just purge your cache and go back to Facebook object debugger page mentioned by @Alex C and then click on Fetch new scrape information.

如果您使用的是 W3 Total Cache 之类的插件,只需清除缓存并返回@Alex C 提到的 Facebook 对象调试器页面,然后单击获取新的抓取信息。

This solved the issue for me

这为我解决了这个问题