What the hell is Open Graph?

March 13, 2024

Imagine you've created an amazing blog post or created a visually stunning product page. But when you share the link on social media, it appears with a generic title, a non-sense description, and no image. Not exactly the best thing!

This is where Open Graph (OG) tags come in. These tags act like a social media translator for web pages. They tell different platforms like Facebook, Twitter, and LinkedIn how to display your content when it's shared.

Benefits

  • Visual storytelling: OG tags allow you to choose the image that appears alongside your link. This is crucial for grabbing attention in a social media feed overflowing with text.
  • Headlines: First impressions are everything, and OG tags allow you to curate the perfect preview for your content.
  • Brand consistency: Ensure your brand's message stays uniform across platforms.
  • SEO advantage: While not a direct ranking factor, compelling social media previews can lead to more clicks and engagement, which can indirectly improve your search engine optimization.

Still not convinced?

  • Increased CTR (Click-Through Rates): Eye-catching visuals and good headlines can significantly increase the number of people who visit your website from social media.
  • Improved brand awareness: Stand out from the crowd with a professional and visually appealing presence.
  • Driving traffic: Get more eyes on your content, potentially leading to more leads or sales.

Getting started

Adding OG tags is a relatively simple process. There are numerous online tools and plugins available to streamline the implementation on your website. However, it's important to remember that these tags reside in the code of your webpage. You can always check Open Graph website for the full list of supported tags but here is a list of tags that I usually use:

Main tags

  • og:title : Defines the title that appears in the social media preview (ideally under 60 characters).
  • og:type : Specifies the type of content being shared. Common types are:
    • article (for blog posts, news articles)
    • website (for general websites)
    • book (for books)
    • product (for products)
    • video (for videos)
    • More types are available. Check OG documentations!
  • og:image : Provides the URL of a high-quality image (ideally at least 1200x630 pixels) that will be displayed in the social media preview.
  • og:description : A concise (ideally under 200 characters) summary of your content that appears in the social media preview.
  • Additional Optional OG Tags:
    • og:url: The canonical URL of the web page being shared. (default: current page URL)
    • og:site_name: The name of your website.
    • og:locale: The language of the content.
    • og:audio: URL to an audio file (if you have one).
    • og:video: URL to a video file (if you have one).

Example

This post is just an introduction to OpenGraph but if it was a comprehensive guide, tags would look like this:

<head>
  <title>A Comprehensive Guide to Open Graph (OG) Tags</title>
  <meta name="description" content="Master OG tags to enhance your social media sharing and engagement." />
  
  <meta property="og:title" content="A Comprehensive Guide to Open Graph (OG) Tags" />
  <meta property="og:type" content="article" />
  <meta property="og:image" content="https://example.com/banner.jpg" />
  <meta property="og:description" content="Learn everything you need to know about OG tags, from their importance to implementation. Boost your social media sharing and engagement!" />
  <meta property="og:url" content="https://www.example.com/your-article-page" />
</head>