Inferensys

Glossary

Open Graph Protocol (OGP)

A markup standard that enables web pages to become rich objects in social graphs, controlling how URLs are displayed when shared on social media platforms like Facebook and LinkedIn.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
SOCIAL METADATA STANDARD

What is Open Graph Protocol (OGP)?

The Open Graph Protocol (OGP) is a semantic markup standard that transforms web pages into structured, visually compelling objects within social graphs, enabling precise control over how URLs are displayed when shared on platforms like Facebook, LinkedIn, and Twitter.

Introduced by Facebook in 2010, the Open Graph Protocol relies on <meta> tags placed in a page's <head> to define canonical properties such as og:title, og:description, og:image, and og:url. This structured metadata instructs social platforms on exactly which title, summary, and image to render in a share preview, preventing the scraper from guessing and often displaying irrelevant or low-quality content.

OGP is foundational to automated metadata tagging pipelines, where systems programmatically generate these tags from structured data to ensure consistent branding at scale. It works in concert with Schema Markup Generation and JSON-LD Serialization to create a comprehensive semantic layer, while og:type values like article or video.movie enable platforms to treat content as specific rich objects within their social graphs.

SOCIAL GRAPH PRIMITIVES

Key Properties of Open Graph Protocol

The Open Graph Protocol (OGP) transforms any URL into a rich, structured object within a social graph by defining a set of metadata properties that control how content appears when shared on platforms like Facebook, LinkedIn, and Twitter.

02

Structured Property Inheritance

OGP uses an RDFa-based type system where object types inherit properties from parent types in a defined hierarchy. For example:

  • og:type business.bank inherits all properties from business.local_business, which inherits from business, which inherits from place.
  • This means a bank can use place:location:latitude and place:location:longitude without redefining them.
  • Custom verticals like music.album or video.episode expose domain-specific properties (music:song, video:actor) that generic types do not.

This inheritance model allows platforms to render rich, type-specific previews—such as a music player for a song or a map for a restaurant—based on the declared type.

04

Optional Metadata Enhancements

Beyond the four required properties, OGP defines optional tags that significantly improve the shared experience:

  • og:description: A one-to-two sentence summary displayed below the title. Facebook truncates at approximately 200 characters.
  • og:site_name: The human-readable name of the overall site, displayed in grey text above the title on Facebook.
  • og:locale: Declares the language and optional territory (e.g., en_US), enabling platforms to serve the correct localized preview.
  • og:video: An absolute URL to a video file or SWF player, which can render an inline playable preview on Facebook.
  • og:audio: An absolute URL to an audio file, used by platforms like Spotify to render an inline audio player.

These properties collectively determine whether a shared link appears as a simple text link or a rich, interactive card.

05

Crawler Caching and Scraping

Social platforms do not fetch OGP tags in real-time on every share. Instead, they employ aggressive caching:

  • Facebook's crawler (facebookexternalhit/1.1) fetches the URL once and caches the parsed OGP data for approximately 30 days.
  • LinkedIn's crawler (LinkedInBot/1.0) caches for 7 days.
  • Twitter's card bot (Twitterbot/1.0) caches for approximately 7 days.

To force a cache refresh after updating tags, developers must use platform-specific debugging tools:

Failing to manually refresh the cache after a tag update means old, incorrect previews persist for weeks.

06

Fallback Behavior and Tag Precedence

When OGP tags are missing, platforms apply a fallback hierarchy to construct a preview:

  • Title fallback: og:title<title> tag → <h1> heading → URL path.
  • Description fallback: og:description<meta name="description"> → first 200 characters of body text.
  • Image fallback: og:image → first <img> tag over 200x200 pixels → no image.

This fallback behavior is unreliable and often produces poor results—such as pulling a logo or spacer GIF as the preview image. Explicit OGP tags are the only way to guarantee a professional, controlled social preview. Additionally, Twitter Cards (twitter:card) take precedence on Twitter only if OGP tags are absent; if both exist, Twitter defers to OGP.

OPEN GRAPH PROTOCOL

Frequently Asked Questions

Clear, technical answers to the most common questions about implementing and debugging the Open Graph Protocol for rich social media sharing.

The Open Graph Protocol (OGP) is a semantic markup standard, originally created by Facebook, that enables any web page to become a rich object in a social graph. It works by injecting specific <meta> tags into the <head> of an HTML document. When a URL is shared on platforms like LinkedIn, Twitter (as a fallback), or Discord, their crawlers—such as the Facebook Crawler—parse these og: prefixed tags to construct a visually compelling preview. This preview typically includes a title, description, image, and canonical URL, transforming a plain hyperlink into an interactive, multimedia-rich card that significantly increases click-through rates and user engagement.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.