LEARNING OBJECTIVES โต
- Understand the role of
og:typein defining the schema classification of a social graph node. - Explore the core
og:typecategories:website,article,profile,book,music.*, andvideo.*. - Declare secondary RDFa namespaces (
profile:,book:,music:,video:) in the<html>prefix attribute. - Recognize how social platforms alter their UI preview cards based on the declared object type.
๐ The Mental Model & Story (Intuitive Foundation)
Imagine entering a vast university library. Every item in the building is cataloged, but they are not all treated the same:
- A Book has an author, ISBN number, and release date.
- A Feature Film DVD has a director, runtime duration, rating, and cast list.
- A Music Album has a musician, track list, and record label.
- A Student ID Badge represents an individual person with a first name, last name, and username.
- The Library Homepage is just a generic front desk portal.
[og:type Root]
โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โผ โผ โผ โผ โผ
[ website ] [ article ] [ profile ] [ book ] [ video.* ]
Root portals Blog posts, Resumes, bios, eBooks, Movies, episodes,
& landing pages news, guides team members manuals streams
If you slap a "Book" label on a feature film DVD, the catalog system won't know where to display the director or runtime. In the Open Graph Protocol, og:type tells the social crawler which schema template to apply to your page.
Technical Deep Dive & Specifications
The Open Graph Type Hierarchy
The og:type attribute determines which additional metadata namespaces can be attached to the document. If you do not specify og:type, parsers default to "website".
<!-- Generic Web Page / Homepage -->
<meta property="og:type" content="website">
<!-- Editorial Article / Tutorial / News -->
<meta property="og:type" content="article">
<!-- Human Person / Developer Bio -->
<meta property="og:type" content="profile">
Comprehensive Open Graph Types Matrix
og:type Value |
Category | Associated Namespaces & Attributes | Platform UI Rendering Behavior |
|---|---|---|---|
website |
Root / Default | Standard og:* properties |
Standard link preview card with large image, domain, title, and description. |
article |
Editorial Publishing | article:published_time, article:author, article:section, article:tag |
Displays author bylines, reading time estimates, and publication dates in news feeds. |
profile |
Individual Person | profile:first_name, profile:last_name, profile:username, profile:gender |
Formats the card as a personal profile badge; highlights full name and handle. |
book |
Literary Work | book:author, book:isbn, book:release_date, book:tag |
Adds literary metadata; links author profile nodes. |
video.movie |
Feature Film | video:director, video:actor, video:duration, video:release_date |
Renders media duration badge and play button overlays. |
video.episode |
TV / Series Episode | video:series, video:actor, video:duration |
Links to the parent series graph node. |
video.other |
General Video / Clip | video:duration, video:release_date |
Renders inline video player preview (if og:video is provided). |
music.song |
Audio Track | music:duration, music:album, music:musician |
Renders audio waveform preview and track duration. |
music.album |
Music Album | music:song, music:release_date, music:musician |
Renders album art and track count. |
Namespace Declarations in RDFa
When using specialized og:type values (such as profile or article), standard RDFa rules require declaring the corresponding namespace in the root <html> tag's prefix attribute:
<!DOCTYPE html>
<html lang="en" prefix="og: https://ogp.me/ns#
profile: https://ogp.me/ns/profile#
article: https://ogp.me/ns/article#
book: https://ogp.me/ns/book#
video: https://ogp.me/ns/video#
music: https://ogp.me/ns/music#">
<head>
<!-- Metadata Tags -->
</head>
Modeling Personal Profiles (og:type="profile")
The profile type is designed for personal portfolios, team member bios, speaker pages, and resume websites.
<meta property="og:type" content="profile">
<meta property="profile:first_name" content="Sarah">
<meta property="profile:last_name" content="Chen">
<meta property="profile:username" content="sarahchen_dev">
<meta property="profile:gender" content="female">
Modeling Books and Documentation (og:type="book")
<meta property="og:type" content="book">
<meta property="book:author" content="https://example.com/authors/martinfowler">
<meta property="book:isbn" content="978-0134757599">
<meta property="book:release_date" content="2018-11-20">
<meta property="book:tag" content="Refactoring">
<meta property="book:tag" content="Software Engineering">
๐ป Interactive Code Playground
Starter Code
Line-by-Line Code Breakdown
- Line 2 (
prefix="og: ... profile: ..."): Registers both the primaryog:namespace and the secondaryprofile:namespace. - Line 12 (
og:typewithcontent="profile"): Declares this node as an individual human profile entity. - Line 18โ21 (
profile:*tags): Supplies granular identity attributes (first_name,last_name,username,gender) enabling social engines to index the person in their entity graph.
Expected Browser Render Output
Expected Social Card Preview (LinkedIn / Slack)
Elena Rostova
Staff Distributed Systems Engineer & Open Source Maintainer.โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] โ
โ [ PHOTO: ELENA ROSTOVA (STAFF DISTRIBUTED SYSTEMS ENGINEER) ] โ
โ [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] โ
โ โ
โ EROSTOVA.DEV โข PROFILE (@erostova) โ
โ Elena Rostova โ Staff Distributed Systems Engineer โ
โ Portfolio and engineering research of Elena Rostova, โ
โ specializing in consensus algorithms, Raft, and high-throughput โ
โ streaming systems. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐๏ธ Hands-On Exercise
๐ฏ The Challenge: Author an OGP Header for a Developer Profile Portfolio
Instructions:
- Create an HTML
<head>for a senior engineer: Alex Rivera. - Add the proper
prefixattribute forog:andprofile:. - Set
og:typeto"profile". - Configure the profile properties:
- First name:
Alex - Last name:
Rivera - Username:
arivera_code
- First name:
- Configure high-DPI image assets at
https://alexrivera.io/images/alex-og.pngwith explicit 1200ร630 dimensions.
๐ Starter Code Sandbox
โ ๏ธ Common Pitfalls
- Inventing Unsupported
og:typeValues: Writing<meta property="og:type" content="blog">orcontent="product_page"is invalid. The OGP specification only supports standardized types (website,article,profile,book,video.*,music.*). Unsupported types will be treated as generic"website". - Using
og:type="article"on the Root Homepage: A homepage should almost always beog:type="website". Only individual blog posts, news stories, and technical articles should usearticle. - Omitting the Secondary Prefix Namespace: Using
profile:first_namewithout declaringprefix="profile: https://ogp.me/ns/profile#"causes strict RDFa validators to report parsing errors.
๐ก Pro Tips
- Match Schema.org Types with
og:type: Maintain consistency between your Open Graph types and your Schema.org JSON-LD definitions. Ifog:typeis"article", your JSON-LD@typeshould be"TechArticle","NewsArticle", or"BlogPosting". - Leverage
video.moviefor Streaming Platforms: If building a media catalog, declaringog:type="video.movie"allows platforms like Facebook to show duration badges and actor cross-links in social graphs.
๐ Key Takeaways
og:typedefines the schema classification of the web page node in the social graph.- The default type is
website; specific content should usearticle,profile,book,video.*, ormusic.*. - Specialized types unlock dedicated child namespaces (e.g.,
profile:*,article:*,book:*). - Custom namespaces should be registered in the
<html>root tag using theprefixattribute. - Never use invented or non-standard types like
"blog"or"tutorial"; use"article"instead. - --