OG Image Monitoring: How to Detect Broken Social Share Cards

Set up automated monitoring for your Open Graph tags. Detect broken og:image URLs, missing meta tags, and stale previews before your users see them.

Why OG monitoring matters

OG tags break silently. You deploy a new version, change your image CDN, update a CMS template — and suddenly every link shared on Twitter, Slack, and LinkedIn looks broken. Nobody tells you. Traffic just drops.

Unlike your homepage uptime (which you probably monitor), OG tags are invisible until someone shares a link. By then, the damage is done — a broken preview in a popular tweet or Slack channel can mean hundreds of lost clicks.

OG monitoring automates the detection of broken social share cards so you can fix them before your users — or your boss — notices.

What to monitor

  • og:image URL is reachable: The image URL must return HTTP 200 with a valid image content type
  • og:image dimensions: Must be at least 1200×630 for large cards on Twitter/LinkedIn
  • og:title is present: Missing titles show the raw URL instead — ugly and unprofessional
  • og:description exists: Without it, platforms show nothing or auto-extract garbled text
  • twitter:card is set: Without this, Twitter defaults to a tiny thumbnail instead of a large image card
  • Canonical URL matches: Mismatched og:url can cause platforms to show the wrong preview
  • Image file size: Keep OG images under 5MB — some platforms reject larger files

Build a simple OG monitoring script

Here's a Node.js script that checks your critical pages for OG tag issues:

// og-monitor.mjs
const URLS = [
  'https://mysite.com',
  'https://mysite.com/pricing',
  'https://mysite.com/blog',
  'https://mysite.com/blog/getting-started',
];

async function checkOg(url) {
  const res = await fetch(url);
  const html = await res.text();
  
  const issues = [];
  
  // Check og:title
  if (!html.includes('og:title')) {
    issues.push('Missing og:title');
  }
  
  // Check og:image
  const ogImageMatch = html.match(
    /property="og:image"\s+content="([^"]+)"/
  );
  if (!ogImageMatch) {
    issues.push('Missing og:image');
  } else {
    // Verify image is reachable
    try {
      const imgRes = await fetch(ogImageMatch[1], { method: 'HEAD' });
      if (!imgRes.ok) {
        issues.push(`og:image returns ${imgRes.status}`);
      }
    } catch (e) {
      issues.push(`og:image unreachable: ${e.message}`);
    }
  }
  
  // Check og:description
  if (!html.includes('og:description')) {
    issues.push('Missing og:description');
  }
  
  // Check twitter:card
  if (!html.includes('twitter:card')) {
    issues.push('Missing twitter:card');
  }
  
  return { url, issues, ok: issues.length === 0 };
}

async function main() {
  console.log('🔍 Checking OG tags...\n');
  
  for (const url of URLS) {
    const result = await checkOg(url);
    if (result.ok) {
      console.log(`✅ ${url}`);
    } else {
      console.log(`❌ ${url}`);
      result.issues.forEach(i => console.log(`   → ${i}`));
    }
  }
}

main();

Automate with CI/CD

Run OG checks as part of your deployment pipeline to catch issues before they reach production:

# .github/workflows/og-check.yml
name: OG Tag Check
on:
  deployment_status:
    types: [completed]

jobs:
  check-og:
    if: github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: node og-monitor.mjs
        env:
          BASE_URL: ${{ github.event.deployment_status.target_url }}

Scheduled monitoring with cron

For ongoing monitoring, run your OG check on a schedule and alert when issues are found:

# .github/workflows/og-monitor-scheduled.yml
name: OG Monitor (Scheduled)
on:
  schedule:
    - cron: '0 */6 * * *'  # Every 6 hours

jobs:
  monitor:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: |
          result=$(node og-monitor.mjs 2>&1)
          if echo "$result" | grep -q "❌"; then
            echo "OG issues detected!"
            # Send alert (Slack webhook, email, etc.)
            curl -X POST $SLACK_WEBHOOK -d "{
              \"text\": \"🚨 OG Tag Issues Detected\n$result\"
            }"
            exit 1
          fi

Platform cache monitoring

Even if your OG tags are correct, platforms cache previews aggressively. After updating OG tags, you need to purge caches:

  • Twitter: Use Card Validator to force a re-scrape
  • Facebook/Instagram: Use the Sharing Debugger to clear cache
  • LinkedIn: Use the Post Inspector to refresh
  • Slack: No manual purge — cache expires in ~30 minutes
  • Discord: No manual purge — cache expires after a few hours

Pro tip: Append a cache-busting query parameter to your og:image URL after updates. Change ?v=1 to ?v=2 and platforms will fetch the new image.

Instant OG monitoring for any URL

Don't build monitoring from scratch — OGFixer checks all your OG tags instantly and shows you exactly how every platform renders your links.

Check your OG tags now →