LinkedIn精选版块添加网站显示错误Facebook图标问题求助
问题根因
你配置的Open Graph元标签存在多处格式错误,LinkedIn爬虫无法识别到你指定的预览图,就会按照页面图片加载顺序抓取第一个符合尺寸要求的可见图片,也就是导航栏的Facebook图标,具体错误点如下:
- og:image元标签格式错误:当前
og:image的content属性值外包裹了多余的方括号,爬虫无法正常识别该图片地址,会直接跳过该配置。
错误代码:<meta name="image" property="og:image" content="[http://collteq.com/images/george.jpg]"> - og:url元标签格式错误:
og:url的content值同时写了双斜杠和http协议前缀//http://,属于非法URL格式,会影响整个Open Graph协议的识别效果。
错误代码:<meta property='og:url' content='//http://collteq.com/walrus.html'/> - 缺少LinkedIn抓取要求的图片补充属性:LinkedIn抓取预览图时会优先识别明确标注了宽高的图片,你当前没有配置
og:image:width、og:image:height属性,会进一步降低指定预览图的识别优先级。
修复方案
将页面head区域的Open Graph相关元标签替换为如下内容:
<meta property="og:title" content="The Walrus" /> <meta property="og:type" content="website" /> <!-- 去掉URL外层多余的方括号 --> <meta property="og:image" content="http://collteq.com/images/george.jpg"> <!-- 补充图片宽高属性,数值和你实际使用的预览图尺寸保持一致即可 --> <meta property="og:image:width" content="350"> <meta property="og:image:height" content="350"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="Description" content="This is a Beatles fan site, which contains information on the solo careers of John Lennon, Paul McCartney, George Harrion and Ringo Starr."/> <!-- 修正og:url的非法格式 --> <meta property='og:url' content='http://collteq.com/walrus.html'/>
修改完成后等待1-2天,LinkedIn此前缓存的旧页面数据会自动失效,重新抓取后就会显示你指定的预览图。
内容的提问来源于stack exchange,提问作者Dan
相关产品推荐
相关产品推荐

