Social Media Meta Tags

Loading concept...

Social Media Meta Tags: Your Website’s Business Card

The Story of Two Shared Links

Imagine you made a beautiful birthday card for your friend. You worked hard on it—pretty colors, nice message, everything perfect!

Now imagine two ways to deliver it:

  1. Boring way: Put it in a plain brown envelope with just your friend’s name scribbled on it.
  2. Exciting way: Put it in a sparkly envelope with a little window showing the pretty design inside, a nice preview of who it’s from, and a hint about what’s inside!

Which one would your friend be more excited to open?

Social media meta tags are like that sparkly envelope! They tell Facebook, Twitter, and other apps what “preview” to show when someone shares your webpage link.


What Are Meta Tags?

Think of meta tags as secret notes you write in your webpage’s <head> section. Regular visitors don’t see them, but social media robots read them to know how to display your link.

<head>
  <!-- Regular stuff -->
  <title>My Page</title>

  <!-- Secret notes for social media! -->
  <meta property="og:title"
        content="Cool Title Here">
</head>

Without these tags? Social media picks random text and images from your page. It often looks messy and confusing!


Open Graph Meta Tags

What is Open Graph?

Open Graph (OG) was created by Facebook. It’s like a standard language that most social networks understand.

Think of it like this: If social networks were tourists visiting your website, Open Graph is the universal translator that helps them understand what your page is about!

The Essential OG Tags

Here are the four must-have tags:

<head>
  <!-- 1. The Title -->
  <meta property="og:title"
        content="Best Pizza Recipe Ever">

  <!-- 2. What type of content -->
  <meta property="og:type"
        content="article">

  <!-- 3. The preview image -->
  <meta property="og:image"
        content="https://site.com/pizza.jpg">

  <!-- 4. Your page's web address -->
  <meta property="og:url"
        content="https://site.com/pizza">
</head>

More Helpful OG Tags

<!-- Short description (like a movie trailer) -->
<meta property="og:description"
      content="Learn to make pizza
      in 30 minutes!">

<!-- Your website's name -->
<meta property="og:site_name"
      content="Cooking Fun">

<!-- Language of the page -->
<meta property="og:locale"
      content="en_US">

OG Image Rules

Your preview image is super important! Here are the rules:

Rule Recommendation
Size 1200 x 630 pixels
Format JPG or PNG
File size Under 1MB
Important stuff Keep in center

Twitter Card Meta Tags

Why Twitter is Different

Twitter can read Open Graph tags, but it has its own special tags called Twitter Cards. Using Twitter’s own tags gives you more control over how your link looks on Twitter!

Types of Twitter Cards

graph TD A[Twitter Card Types] --> B[Summary] A --> C[Summary Large Image] A --> D[App Card] A --> E[Player Card] B --> F[Small square image<br>Good for articles] C --> G[Big wide image<br>Great for photos] D --> H[Shows app download] E --> I[Shows video player]

Basic Twitter Card Tags

<head>
  <!-- Which card style to use -->
  <meta name="twitter:card"
        content="summary_large_image">

  <!-- Your Twitter username -->
  <meta name="twitter:site"
        content="@yourhandle">

  <!-- Title (or uses og:title) -->
  <meta name="twitter:title"
        content="Best Pizza Recipe">

  <!-- Description -->
  <meta name="twitter:description"
        content="Learn to make pizza!">

  <!-- Preview image -->
  <meta name="twitter:image"
        content="https://site.com/pizza.jpg">
</head>

Twitter’s Fallback Magic

Here’s a cool trick: Twitter will fallback to Open Graph tags if you don’t set Twitter-specific ones!

graph TD A[Twitter Looks For] --> B{twitter:title<br>exists?} B -->|Yes| C[Use twitter:title] B -->|No| D{og:title<br>exists?} D -->|Yes| E[Use og:title] D -->|No| F[Use page title]

So you can set OG tags first, then only add Twitter tags when you want something different!


Complete Example: Both Together!

Here’s how a real webpage combines both:

<!DOCTYPE html>
<html>
<head>
  <title>Amazing Pizza Recipe</title>

  <!-- Open Graph (Facebook, LinkedIn) -->
  <meta property="og:title"
        content="Amazing Pizza Recipe">
  <meta property="og:type"
        content="article">
  <meta property="og:image"
        content="https://my.site/pizza.jpg">
  <meta property="og:url"
        content="https://my.site/pizza">
  <meta property="og:description"
        content="Make restaurant pizza
        at home in 30 minutes!">

  <!-- Twitter Card -->
  <meta name="twitter:card"
        content="summary_large_image">
  <meta name="twitter:site"
        content="@PizzaLover">

</head>
<body>
  <!-- Your page content -->
</body>
</html>

Notice: We set Twitter card type and site, but Twitter will use our OG title, image, and description!


Testing Social Share Previews

Why Test?

You wrote all these tags… but how do you know they work? What if you made a typo? What if your image is too small?

Always test before sharing!

Free Testing Tools

1. Facebook Sharing Debugger

URL: developers.facebook.com/tools/debug/

What it does:

  • Shows exactly what Facebook sees
  • Tells you if something is wrong
  • Lets you “scrape again” to refresh cache

2. Twitter Card Validator

URL: cards-dev.twitter.com/validator

What it does:

  • Shows your Twitter Card preview
  • Lists any errors or warnings
  • Must be logged into Twitter

3. LinkedIn Post Inspector

URL: linkedin.com/post-inspector/

What it does:

  • Shows LinkedIn preview
  • Helps clear LinkedIn’s cache
  • Shows all detected meta tags

Testing Workflow

graph TD A[Add Meta Tags] --> B[Save & Deploy] B --> C[Test on Facebook] C --> D{Looks good?} D -->|No| E[Fix issues] E --> A D -->|Yes| F[Test on Twitter] F --> G{Looks good?} G -->|No| E G -->|Yes| H[Ready to share!]

Common Testing Problems

Problem Solution
Old image showing Use debugger’s “Scrape Again”
Image not showing Check URL is absolute & public
Wrong text Make sure og:title is correct
No preview at all Check for typos in property names

Quick Reference Cheat Sheet

Must-Have Tags

<!-- For Everyone -->
<meta property="og:title" content="...">
<meta property="og:image" content="...">
<meta property="og:url" content="...">
<meta property="og:description" content="...">

<!-- For Twitter -->
<meta name="twitter:card"
      content="summary_large_image">

Property vs Name

Notice the difference?

  • Open Graph: Uses property="og:..."
  • Twitter: Uses name="twitter:..."

This is important! Using the wrong one means the tag won’t work.


The Big Picture

graph TD A[Your Webpage] --> B[Someone shares link] B --> C{Which platform?} C --> D[Facebook] C --> E[Twitter] C --> F[LinkedIn] C --> G[Others] D --> H[Reads og: tags] E --> I[Reads twitter: tags<br>Falls back to og:] F --> H G --> H H --> J[Shows pretty preview!] I --> J

You Did It!

Now you know how to make your website links look beautiful when shared on social media!

Remember:

  1. Open Graph = The universal language most platforms understand
  2. Twitter Cards = Twitter’s special tags (optional but nice)
  3. Always test = Use free tools before sharing

Your links will never look boring again!

Loading story...

No Story Available

This concept doesn't have a story yet.

Story Preview

Story - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

Interactive Preview

Interactive - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

No Interactive Content

This concept doesn't have interactive content yet.

Cheatsheet Preview

Cheatsheet - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

No Cheatsheet Available

This concept doesn't have a cheatsheet yet.

Quiz Preview

Quiz - Premium Content

Please sign in to view this concept and start learning.

Upgrade to Premium to unlock full access to all content.

No Quiz Available

This concept doesn't have a quiz yet.