Open Graph Protocol

May 7, 2026 · 8min

Introduction

The Open Graph Protocol enables any web page to become a rich object within a social graph. For instance, adopted by Facebook, it empowers web pages to feature identical capabilities as native objects hosted on the platform.

A wide array of independent technologies and markup standards exist and can be combined, yet none individually supply sufficient metadata to fully represent arbitrary webpages as structured social graph entities. Built upon existing specifications, the Open Graph Protocol unifies implementation requirements for developers. Ease of integration for developers stands as a core design principle, guiding nearly all architectural decisions of the protocol.

Core Metadata

To convert a webpage into a graph object, essential metadata tags must be embedded into the page source. The initial protocol specification was developed based on RDFa, requiring additional <meta> markup inside the HTML <head> block. Four mandatory attributes apply to every compliant page:

  • og:title: The display name of the object rendered in the graph (e.g., The Rock).

  • og:type: Classification of the target object (e.g., video.movie). Supplementary metadata may be required depending on the specified type value.

  • og:image: Full URL pointing to a representative preview image of the graph object.

  • og:url: Canonical permanent URL serving as the unique persistent identifier for the graph object (e.g., https://www.imdb.com/title/tt0117500/).

Below is a practical Open Graph markup sample for the film The Rock on IMDb:

<html prefix="og: https://ogp.me/ns#">
    <head>
        <title>The Rock (1996)</title>
        <meta property="og:title" content="The Rock" />
        <meta property="og:type" content="video.movie" />
        <meta property="og:url" content="https://www.imdb.com/title/tt0117500/" />
        <meta property="og:image" content="https://ia.media-imdb.com/images/rock.jpg" />
        ...
    </head>
...
</html>

Optional Metadata

The following attributes are optional yet generally recommended for all object types:

  • og:audio: Source URL of an audio file accompanying the target object.

  • og:description: One or two descriptive sentences summarizing the object content.

  • og:determiner: Preceding article placed before the object’s title; enumerated values: a, an, the, empty string, auto. When set to auto, consuming applications automatically select between a and an. Defaults to a blank value.

  • og:locale: Primary locale formatted as language_TERRITORY; default value: en_US.

  • og:locale:alternate: Alternative available locales supported by the page, usable multiple times.

  • og:site_name: Brand name of the parent website when the object belongs to a larger site (e.g., IMDb).

  • og:video: Source URL of a supplementary video asset for the object.

Sample implementation snippet (line breaks added solely for readability):

<meta property="og:audio" content="https://example.com/bond/theme.mp3" />
<meta property="og:description" 
  content="Sean Connery found fame and fortune as the suave, sophisticated British agent, James Bond." />
<meta property="og:determiner" content="the" />
<meta property="og:locale" content="en_GB" />
<meta property="og:locale:alternate" content="fr_FR" />
<meta property="og:locale:alternate" content="es_ES" />
<meta property="og:site_name" content="IMDb" />
<meta property="og:video" content="https://example.com/bond/trailer.swf" />

The full RDF schema written in Turtle syntax is available at ogp.me/ns.

Structured Metadata Attributes

Certain core fields accept nested supplementary metadata, declared following the standard property/content meta syntax with extra colons within the property key.

og:image: Extended Properties

  • og:image:url: Equivalent to the base og:image field.

  • og:image:secure_url: Alternative HTTPS-compliant image URL for secure webpage environments.

  • og:image:type: Official MIME type of the target image file.

  • og:image:width: Image pixel width in numeric format.

  • og:image:height: Image pixel height in numeric format.

  • og:image:alt: Descriptive alt text for image content (distinct from title). Pages defining og:image are strongly advised to include this field.

Full image markup example:

<meta property="og:image" content="https://example.com/ogp.jpg" />
<meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />
<meta property="og:image:alt" content="A shiny red apple with a bite taken out" />

og:image Equivalent Rules for og:video

og:video inherits all nested sub-attributes defined for og:image:

<meta property="og:video" content="https://example.com/movie.swf" />
<meta property="og:video:secure_url" content="https://secure.example.com/movie.swf" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video:width" content="400" />
<meta property="og:video:height" content="300" />

og:audio Limited Subfields

Only the first three structured attributes apply to audio assets (dimension parameters are irrelevant for audio files):

<meta property="og:audio" content="https://example.com/sound.mp3" />
<meta property="og:audio:secure_url" content="https://secure.example.com/sound.mp3" />
<meta property="og:audio:type" content="audio/mpeg" />

Array Values

To assign multiple values to a single Open Graph field, duplicate the corresponding <meta> tag repeatedly in HTML source. When conflicts emerge, tags appearing earlier in source code take precedence over subsequent ones.

<meta property="og:image" content="https://example.com/rock.jpg" />
<meta property="og:image" content="https://example.com/rock2.jpg" />

Nested structured attributes must be defined immediately after their root parent tag. Parsers terminate the current object’s structured metadata upon encountering a new root property and initialize a fresh object entry.

Sample markup explanation:

<meta property="og:image" content="https://example.com/rock.jpg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta property="og:image" content="https://example.com/rock2.jpg" />
<meta property="og:image" content="https://example.com/rock3.jpg" />
<meta property="og:image:height" content="1000" />

This snippet registers three separate preview images: the first sized 300×300px, the second with unspecified dimensions, and the third with a fixed height of 1000px.

Object Typing Specification

Object categorization inside the social graph is specified via the og:type attribute:

<meta property="og:type" content="website" />

Type definitions get added to the official global registry once standardized via community consensus. Custom non-standard types follow the CURIE format syntax with custom namespace declarations:

<head prefix="my_namespace: https://example.com/ns#">
<meta property="og:type" content="my_namespace:my_type" />

Global standardized types are grouped into vertical industry categories with dedicated namespaces. Official global types use dot separators after namespace prefixes, while custom user-defined types use colons to avoid syntax ambiguity.

Music Vertical

Namespace URI: https://ogp.me/ns/music#

Available og:type values:

music.song

  • music:duration: Integer ≥1, total runtime of the track measured in seconds.

  • music:album: Array of music.album entries referencing parent albums containing this track.

  • music:album:disc: Integer ≥1, disc index of the album holding the song.

  • music:album:track: Integer ≥1, sequential track number within the target disc.

  • music:musician: Array of profile objects listing contributing artists.

music.album

  • music:song: Associated music.song entries featured on the album.

  • music:song:disc: Matches definition of music:album:disc for linked tracks.

  • music:song:track: Matches definition of music:album:track for linked tracks.

  • music:musician: Profile entry for the album’s primary creators.

  • music:release_date: Datetime value marking official album launch date.

music.playlist

  • music:song, music:song:disc, music:song:track: Consistent parameters with music.album.

  • music:creator: Profile data of the playlist author.

music.radio_station

  • music:creator: Profile data of the station founder or operator.

Video Vertical

Namespace URI: https://ogp.me/ns/video#

Available og:type values:

video.movie

video:actor: Array of cast member profile entries.

video:actor:role: String specifying each performer’s on-screen character.

video:director: Array of director profile entries.

video:writer: Array of screenwriter profile entries.

video:duration: Integer ≥1, total runtime in seconds.

video:release_date: Official premiere datetime.

video:tag: String array of descriptive keyword tags for the motion picture.

video.episode

Inherits all metadata fields of video.movie plus one exclusive parameter:

video:series: Linked video.tv_show object indicating the parent television series.

video.tv_show

Multi-episode television series; shares full metadata specification with video.movie.

video.other

Catch-all type for uncategorized video content, with identical metadata rules as video.movie.

Cross-Vertical Global Types

Widely adopted standardized object types unassigned to dedicated vertical categories:

article | Namespace: https://ogp.me/ns/article#

  • article:published_time: Original content publish datetime.

  • article:modified_time: Last content revision datetime.

  • article:expiration_time: Content expiry cutoff datetime.

  • article:author: Array of author profile entries.

  • article:section: Top-level content category label (e.g., Technology).

  • article:tag: Keyword array for article categorization.

book | Namespace: https://ogp.me/ns/book#

  • book:author: Array of author profile entries.

  • book:isbn: Standard ISBN identification string.

  • book:release_date: Official publication date.

  • book:tag: Relevant keyword tag array.

profile | Namespace: https://ogp.me/ns/profile#

  • profile:first_name: Given or chosen personal given name.

  • profile:last_name: Surname inherited via lineage or marriage.

  • profile:username: Unique short account identifier string.

  • profile:gender: Enumerated options: male, female.

website | Namespace: https://ogp.me/ns/website#

No supplementary custom attributes beyond core mandatory metadata. All untagged webpages default to og:type="website".