谷歌+一个按钮代码是可见的Facebook缩略图


Google Plus One Button Code is visible on Facebook Thumbnail

我添加了以下标准的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>

我将代码添加到php代码的底部。它按预期工作。然而,当我在Facebook上给出我的页面链接时,它在缩略图中显示了以下代码!我试图从我的网站上删除整个谷歌加一个代码,但当我试图给我的网站在FB的链接,再次这个代码是(只有这个代码顺便说一下)出现在缩略图。那么有什么方法可以防止这些代码在Facebook缩略图中显示呢?

您是否尝试过在您的页面中添加Open Graph标签?比如标题、描述、图片等等?这里是文档,还有一个很棒的工具,可以帮助您查看Facebook如何抓取您的页面。