DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Semantic HTML
  • Accessibility (a11y)
  • Forms & Validation
  • Document Metadata & The <head>
  • The Document Object Model (DOM)
  • Character Encoding & Entities
  • Data Attributes & Custom Data
  • Template, Slot & Web Components
  • Responsive Images: Picture, Source & srcset
  • Loading Strategies & Resource Hints
  • The Native Dialog Element
  • Audio, Video & Media APIs
  • SVG Integration & Canvas Basics
  • Advanced Input Types & Datalist
  • Details, Summary, Progress & Meter
  • Global Attributes & Iframe Security
  • Microdata, Schema.org & Structured Data
  • Open Graph & Social Meta Tags
  • Security Headers & CSP in HTML
  • Link Relations & Canonical Tags
← From Beginner to Expert in Fundamentals of Frontend

Open Graph & Social Meta Tags

10 min read
Open Graphog:titleog:imageTwitter CardsSocial Sharingog:type

Open Graph: Controlling Your Social Media Presence

When someone shares your URL on Facebook, Twitter, LinkedIn, or Slack, these platforms read Open Graph meta tags to generate the preview card.

Essential OG Tags

TagPurposeRecommendation
og:titleShare card titleMax 60 chars
og:descriptionDescription below titleMax 155 chars
og:imagePreview image1200x630px minimum
og:urlCanonical URLFull absolute URL
og:typeContent typewebsite, article, product

Twitter Cards

Twitter uses its own meta tags but falls back to OG. Use twitter:card to control the card size (summary, summary_large_image).

Common Mistakes

  • Using relative URLs (must be absolute)
  • Image too small (minimum 1200x630 for large cards)
  • Not testing with Facebook Debugger / Twitter Card Validator
  • Caching: Social platforms cache previews. Use their debug tools to force a re-scrape after changes.

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.