Open Graph Protocol Fundamentals
You'll learn what the Open Graph protocol is and how it controls how your pages appear when shared on social media.
What is the Open Graph Protocol?
When you share a link on Facebook, Twitter, or LinkedIn, have you noticed how it displays a nice preview card with an image, title, and description? That's the Open Graph protocol at work.
Think of Open Graph tags as instructions for social media platforms: they tell Facebook, LinkedIn, and other sites exactly how to display your content when someone shares it. Without these tags, social platforms guess what to show—often poorly.
The protocol was created by Facebook but has become a web standard. It uses special <meta> tags in your HTML <head> to define structured data about your page.
The Four Required Meta Tags
Every Open Graph implementation needs these four core tags:
<meta property="og:title" content="Amazing Web Development Guide" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://example.com/guide" />
<meta property="og:image" content="https://example.com/image.jpg" />
- og:title — The title displayed in the preview card
- og:type — The content type (website, article, video, etc.)
- og:url — The canonical URL of your page
- og:image — The image shown in social shares
Note the property attribute instead of name—that's specific to Open Graph tags.
Why It Matters
Without Open Graph tags, social platforms might pull random text or the wrong image. With them, you control your brand's appearance across social media, increasing click-through rates and engagement.
Key Takeaway: The Open Graph protocol uses four required meta tags (og:title, og:type, og:url, og:image) to control how your pages appear when shared on social media platforms.