Social Preview
Start with Open Graph title, description, URL, type, and an image with dimensions and alt text. Add Twitter Card fields only when X needs a value that differs from the Open Graph fallback.
Get started
<meta property="og:url" content="https://example.com/page.html">
<meta property="og:title" content="Freshwater Fishing: A Beginner’s Guide">
<meta property="og:description" content="A practical guide to choosing and caring for indoor plants in low-light rooms.">
<meta property="og:type" content="article">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="ExampleCorp">
<meta property="og:image" content="https://example.com/cover.jpg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="600">
<meta property="og:image:alt" content="Team collaborating on a web development project">
<meta name="twitter:image" content="https://example.com/path/to/image.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@contentcreator">
<meta name="twitter:site" content="@exampleUser">
<meta name="twitter:label1" content="Author">
<meta name="twitter:data1" content="42K Tweets">
<meta name="twitter:label2" content="Location">
<meta name="twitter:data2" content="30 mins">Explanation
og:url
propertyProvides the canonical URL used as the object’s permanent identifier. It is one of the four required basic properties.
<meta property="og:url" content="https://example.com/page.html">og:title
propertyProvides the title of the Open Graph object. It is one of the four required basic properties.
<meta property="og:title" content="Freshwater Fishing: A Beginner’s Guide">og:description
propertyProvides a one or two sentence description of the Open Graph object.
<meta property="og:description" content="A practical guide to choosing and caring for indoor plants in low-light rooms.">og:type
propertySets the Open Graph object type. It is one of the four required basic properties, and some types require extra metadata.
<meta property="og:type" content="article">og:locale
propertySets the locale of the Open Graph metadata in language_TERRITORY form. The default is en_US.
<meta property="og:locale" content="en_US">og:site_name
propertyProvides the name of the larger website that contains this object, such as IMDb.
<meta property="og:site_name" content="ExampleCorp">og:image
propertyProvides the URL of an image that represents the Open Graph object. It is one of the four required basic properties.
<meta property="og:image" content="https://example.com/cover.jpg">og:image:width
propertyProvides the width, in pixels, of the preceding og:image resource.
<meta property="og:image:width" content="1200">og:image:height
propertyProvides the height, in pixels, of the preceding og:image resource.
<meta property="og:image:height" content="600">og:image:alt
propertyDescribes what appears in the preceding og:image. It is a description, not a caption.
<meta property="og:image:alt" content="Team collaborating on a web development project">twitter:image
nameProvides the image URL used in an X Card link preview. The metadata name retains the twitter: prefix.
<meta name="twitter:image" content="https://example.com/path/to/image.jpg">twitter:card
nameSelects the X Card format for a page. The metadata still uses the twitter: prefix.
<meta name="twitter:card" content="summary_large_image">twitter:creator
nameAttributes the page’s content to an X account using its @handle. The metadata name retains the twitter: prefix.
<meta name="twitter:creator" content="@contentcreator">twitter:site
nameAttributes the website or publication to an X account using its @handle. The metadata name retains the twitter: prefix.
<meta name="twitter:site" content="@exampleUser">twitter:label1
nameUnsupported legacy Product Card field for the first custom label. X no longer supports Product Cards or publishes this field in its developer documentation.
<meta name="twitter:label1" content="Author">twitter:data1
nameUnsupported legacy Product Card field for the first custom value. X no longer supports Product Cards or publishes this field in its developer documentation.
<meta name="twitter:data1" content="42K Tweets">twitter:label2
nameUnsupported legacy Product Card field for the second custom label. X no longer supports Product Cards or publishes this field in its developer documentation.
<meta name="twitter:label2" content="Location">twitter:data2
nameUnsupported legacy Product Card field for the second custom value. X no longer supports Product Cards or publishes this field in its developer documentation.
<meta name="twitter:data2" content="30 mins">More collections
Start with the closest collection, then trim it to match your page.