Search code examples
phpfacebookthumbnailsgoogle-plusgoogle-plus-one

Google Plus One Button Code is visible on Facebook Thumbnail


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?


Solution

  • 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.