Search code examples
htmlfacebooksocial-media

Default website image for social sharing


Is there any way to set a default image that appears when I share my website on Facebook? I've noticed that Facebook usually fetches the first image from the site to use as a thumbnail.


Solution

  • You need to set the open graph image meta tag:

    <meta property="og:image" content="http://example.com/logo.jpg">
    <meta property="og:image:type" content="image/png">
    <meta property="og:image:width" content="1024">
    <meta property="og:image:height" content="1024">
    

    For more info check the docs