solvit.io

HTML tags that make a website look better when sharing URLs on Twitter

<!-- ... -->
<head>
    <!-- ... -->

    <!-- OpenGraph tags used by Twitter -->
    <meta property="og:url" content="http://example.org/page.html" />
    <meta property="og:title" content="Lorem Ipsum Dolor Sit Amet" />
    <meta property="og:description" content="Lorem Ipsum ..." />
    <!-- ... -->

    <!-- custom Twitter tags -->
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:site" content="@example" />
</head>
<!-- ... -->

OpenGraph tags:

  • They are mainly defined for Facebook, but Twitter processes them too.

Twitter tags:

  • twitter:card, the type of your content (summary, photo, product, etc.) See the full reference of Twitter card types.
  • twitter:site, the Twitter account on which the content was published (including the @ character).
Find more solutions about: , , ,