Search code examples
facebook-opengraphmagento-1.9

Unable to change facebook thumbnail image for magento site


I have added the following code to a magento site to update the FB thumbnail image.

1column.phtml

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">

head.phtml

<meta property ="og:image" content="www.rekinza.com/images/rekinza-fb_logo.jpg"/>

However, Facebook still picks up a random image from the homepage when I put the link in a FB post.

I tried verifying if my changes are getting reflected in the website, so I checked using view-source and found the below result

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">

<meta property ="og:image" content="www.rekinza.com/images/rekinza-fb_logo.jpg"/>

head.phtml

<meta property ="og:image" content="www.rekinza.com/images/rekinza-fb_logo.jpg"/>

Please help ! Ive spent way too manyu hours trying to figure this out.

Thank you !


Solution

  • First of all, correct the URL and make sure there is no misplaced whitespace, with http or https (if you got a certificate):

    <meta property="og:image" content="https://www.rekinza.com/images/rekinza-fb_logo.jpg"/>
    

    Then, check out the specifications for Open Graph images: https://developers.facebook.com/docs/sharing/best-practices#images