Google Plus 一键代码在 Facebook 缩略图上可见
我向我的网站添加了以下标准 Google Plus One 代码。
<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
我将代码添加到 phtml 代码的底部。它按预期工作。然而,当我在 Facebook 中给出我的页面链接时,它在缩略图中显示以下代码!我尝试从我的网站中删除整个 Google Plus One 代码,但是当我尝试在 FB 中提供指向我的网站的链接时,该代码(顺便说一下,只有这个代码)再次出现在缩略图中。那么有什么方法可以防止此代码显示在 Facebook 缩略图上呢?
I added following standard Google Plus One code to my web site.
<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
I add the code to the bottom of my phtml code. It works as intended. However, when I give the link of my page in Facebook, It shows the following code in the thumbnail! I tried removing the whole Google Plus One Code from my site but when I try to give a link to my site in FB, again this code is (only this code by the way) is appearing in thumbnail. So is there any way to prevent this code from being shown at Facebook thumbnails?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过将开放图谱标签添加到您的页面?比如标题、描述、图片等?
这里是文档,还有一个很棒的该工具可帮助您查看 Facebook 如何抓取您的页面。
Have you tried adding Open Graph tags to your page? Like the title, description, image and so on?
Here's the documentation, and there's also a great tool that helps you see how Facebook scrapes your pages.