htmlmeta-tags

Show link preview. I want my link to contain image, title description etc


Currently when I send my website link it doesn't show anything.

I want it to show a preview of my website like so (on Discord):

https://i.sstatic.net/7VCXn.png

What exactly should I add? Perhaps a metatag?? Thank you!


Solution

  • It appears Stack Overflow accomplishes it with the following meta tags:

    <meta property="og:type" content="website">
    <meta property="og:url" content="https://stackoverflow.com/">
    <meta property="og:site_name" content="Stack Overflow">
    <meta property="og:image" itemprop="image primaryImageOfPage" content="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=73d79a89bded">
    <meta name="description" content="Stack Overflow is the largest, most trusted online community for developers to learn, share​ ​their programming ​knowledge, and build their careers.">
    

    The og: symbolizes the tags are part of the Open Graph protocol