Open Graph: What It Is and How to Use It

Share This Post!

Open Graph is a technology introduced by Facebook in 2010 that enables seamless integration between Facebook, its user data, and external websites. By adding Open Graph meta tags to your page’s content, you can control which elements of your page appear when it’s shared on social media platforms.

For instance, with the og:image tag, you can specify which image you want Facebook to display when your page is shared. This way, by setting specific Open Graph data, you avoid leaving Facebook to guess the content to display.

Example of Open Graph Meta Tags

Here’s an example of how Open Graph meta tags might look on a web page. If you’re familiar with HTML meta tags, you’ll notice that the main difference is the use of custom property attributes for Open Graph tags.

<meta property="og:title" content="What is Open Graph?"/>
<meta property="og:description" content="Computer dictionary definition of Open Graph, including related links, information, and terms."/>
<meta property="og:type" content="article"/>
<meta property="og:image" content="https://www.faizanhussain.com/comp/logos/facebook.gif"/>

Adding Open Graph Meta Tags

Like other meta tags, Open Graph tags should be placed within the <head> section of an HTML page. If you manage the HTML code, you can add these tags with any HTML editor. For CMS platforms like WordPress, you can adjust the template or use plugins such as Yoast SEO to handle Open Graph tags.

Overview of Common Open Graph Meta Tags

Below are the most commonly used Open Graph meta tags, along with a brief description of each. While not all tags are required, they help in accurately identifying key elements of your page.

  • og
    The title of the page.
  • og
    The image displayed when the page is shared. The og:image tag is especially useful if your page contains multiple images, as it lets you choose a specific one to represent your content.
    • Note: Facebook requires images to be at least 300px in width and 200px in height.
  • og
    A brief description of the page.
  • og
    Defines the type of content. Examples include article, music.album, video.movie, and website.
  • og
    The canonical URL of the page.
  • og
    Specifies the locale of the content. The default value is en_US (for English in the United States), but you can adjust it as needed for other regions and languages.

Testing Your Open Graph Integration

Facebook offers an Open Graph Debugger tool to test how your page appears when shared on Facebook. This tool helps verify that Open Graph tags are correctly detected and highlights any errors you may need to address.

Share This Post!