Programmer’s Picnic • Sharing Debugging Tool

Open Graph + Twitter Tags
explained, generated, and previewed

This page is both a guide and a tool. It explains what every important og:* and twitter:* tag does, generates a production-ready head block for your page, and shows live preview simulations for Facebook-style, LinkedIn-style, X-style, and WhatsApp-style link cards.

It is designed for real debugging: broken image, old preview, wrong title, bad description, missing canonical, or link cards that refuse to update.

Live preview concept

How to Debug Social Sharing Previews

Generate tags, validate important fields, and simulate how your page might look when shared across major platforms.

1. Generate a correct head

Create a clean set of meta tags for Open Graph, Twitter/X, canonical, and structured data.

2. Understand every tag

Each tag is explained in practical language: what it does, when it matters, and common mistakes.

3. Debug real failures

Use the checklists and preview cards to catch missing data, bad images, or stale cached previews.

Interactive tool

Generate your tags and inspect preview behavior

Fill the fields below. The generator updates the meta tags, validation checks, and preview simulations instantly.

Input details

Facebook / LinkedIn style

X / Twitter style

WhatsApp style

Tip: keep your most important tags high in the <head>. Social crawlers can miss them if the page is bloated or the metadata appears too late.

Open Graph

Every important Open Graph tag explained

Open Graph is the shared language many platforms use to build link previews. These are the tags that matter most in normal web pages and articles.

og:title Required core

What it does: The main title shown in the preview card.

Best practice: Use a human-friendly title, not a raw slug, category trail, or keyword-stuffed sentence.

Common mistake: Using a title that is too long, too generic, or different from the actual page topic.

Example: <meta property="og:title" content="How to Debug Social Sharing Previews" />

og:type Required core

What it does: Tells crawlers what kind of object the page is.

Typical values: website for generic pages and article for blog posts or guides.

Common mistake: Leaving everything as website when article-specific metadata would make more sense.

og:image Required core

What it does: Supplies the preview image used in social cards.

Best practice: Use an absolute HTTPS URL, stable hosting, and a dedicated share image rather than a small logo or random page image.

Common mistake: Using tiny images, relative paths, blocked directories, or images that require cookies or login.

og:url Required core

What it does: Declares the permanent canonical identity of the page in the graph.

Best practice: Match it with the canonical URL and use the final public URL users should share.

Common mistake: Pointing it to the home page, a staging URL, or a redirected URL.

og:description Recommended

What it does: Provides a short summary that many platforms show under the title.

Best practice: Make it clear, useful, and readable in one or two compact sentences.

Common mistake: Dumping the whole intro paragraph, writing vague text, or repeating the title word-for-word.

og:site_name Recommended

What it does: Shows the broader site or brand name.

Best practice: Keep it stable across the site. Example: Learn with Champak.

og:locale Recommended

What it does: Declares the language/region format of the page, such as en_US.

Best practice: Add it if your content has a clear primary locale.

og:image:width and og:image:height Recommended

What they do: Help crawlers understand the image dimensions without guessing.

Best practice: Provide the actual image size when you know it.

Common mistake: Supplying incorrect dimensions or omitting them for important share images.

og:image:alt Recommended

What it does: Describes what is in the image.

Best practice: Describe the image content, not a caption, slogan, or keyword list.

Common mistake: Leaving it blank even though a share image exists.

og:image:secure_url and og:image:type Optional

What they do: Provide an HTTPS image URL and MIME type.

When useful: When you want to be explicit or maintain multiple image declarations cleanly.

og:locale:alternate Optional

What it does: Lists alternate locales for multilingual content.

When useful: When the same page is available in multiple translations.

article:published_time, article:modified_time, article:author Article metadata

What they do: Add article-specific context for pages that are actual posts or guides.

Best practice: Use ISO 8601 dates and keep author naming consistent.

Twitter / X

Twitter card tags explained in practical terms

These tags help shape how the page appears when shared in X/Twitter-style cards. Even when Open Graph exists, many sites still include explicit twitter:* tags for predictable rendering.

twitter:card Most important

What it does: Chooses the card layout.

Common values: summary for a smaller image card and summary_large_image for a larger, more visual card.

Best practice: Use summary_large_image for articles, tutorials, and visual landing pages.

twitter:title Recommended

What it does: Supplies the card title.

Best practice: Usually mirror the OG title unless you need a shorter version for platform fit.

twitter:description Recommended

What it does: Supplies the summary beneath the title.

Best practice: Keep it concise and scannable.

twitter:image Recommended

What it does: Supplies the card image.

Best practice: Use the same share image as og:image unless you intentionally want a platform-specific crop.

twitter:image:alt Optional

What it does: Adds accessible descriptive text for the image.

Best practice: Keep it natural and descriptive, similar to og:image:alt.

twitter:site and twitter:creator Optional

What they do: Associate the card with a brand or author account handle.

When useful: When the project has an active X presence and you want attribution to appear consistently.

Canonical + supporting SEO

Tags that do not create the preview, but still matter

Social cards are not only about OG/Twitter tags. Clean supporting tags reduce ambiguity and make your page easier to index and share correctly.

<link rel="canonical">

Declares the preferred page URL. It should normally match og:url on a simple article page.

Do not point canonical to a different URL unless that is intentionally the master page.

<meta name="description">

Not the same as og:description, but usually similar. Search engines use this for snippets more often than social platforms do.

JSON-LD structured data

Does not replace Open Graph, but adds machine-readable meaning for search engines and richer indexing workflows.

Image strategy

How to choose a social share image that actually works

A broken card is often an image problem, not a tag problem. Use a dedicated share image, not a random in-page image.

Rule What to do Why it matters
Use absolute HTTPS URLs Example: https://www.learnwithchampak.live/assets/social/share.jpg Relative URLs and mixed-content setups can break crawler access.
Use a large, dedicated image Prefer a true social image around 1200×630 Small images often produce poor or missing cards.
Keep important text centered Leave safe margins around the edges Platforms may crop differently.
Do not protect the image No login, no blocked robots path, no cookie requirement Scrapers must fetch it anonymously.
Use stable hosting Keep the image on your public domain or a reliable public CDN Broken assets create broken previews.
Set width and height tags Add og:image:width and og:image:height Reduces guessing and helps parsers resolve the media faster.
Debugging workflow

A practical sequence for fixing wrong previews

Follow this order. It catches the most common issues without random guesswork.

Step-by-step workflow

  1. Open the page source and confirm the final HTML contains the right tags in the <head>.
  2. Confirm og:url and canonical point to the real public page URL.
  3. Open the image URL directly in a private browser tab and confirm it loads publicly.
  4. Check that the image is large enough and not a tiny logo or compressed thumbnail.
  5. Use the official platform tools to force a refresh where available.
  6. Wait for new shares only. Old posts usually keep the old preview.
  7. When in doubt, simplify: one canonical URL, one primary image, one clear title.

Useful tools

Meta Sharing Debugger

LinkedIn Post Inspector

View source of this page

This page also has an internal preview simulator, which is useful before you publish or while refining the title, description, and image.

Mistakes

The failures that cause most broken link cards

These are the issues that repeatedly waste time in production.

Wrong URL identity

og:url points to the home page, an old slug, a redirected page, or a different protocol.

Tiny image

The image is technically valid but too small, heavily cropped, or visually unreadable in social contexts.

Image not public

The image loads for you in session, but a crawler cannot fetch it anonymously.

Meta tags injected too late

Client-side rendering, SPA-only head injection, or bulky head content can confuse crawlers.

Old cache

The page is fixed, but the platform still shows the previous scrape result.

Too many conflicting tags

Multiple titles, inconsistent images, duplicate canonicals, or unrelated OG blocks create ambiguity.

FAQ

Questions people usually ask while debugging

These answers focus on practical behavior rather than theory.

Do I need both Open Graph tags and Twitter tags?

For robust sharing behavior, yes. Open Graph covers many consumers, while explicit twitter:* tags still give you a cleaner, more controlled setup for X/Twitter-style cards.

Should canonical and og:url be the same?

On a normal article or blog page, usually yes. Both should point to the same public URL that represents the page.

Why did I update the tags but the old preview still appears?

Cached metadata. Use the debugger or inspector where available, then test with a new share. Old posts may keep the old preview.

Can I use my site logo as og:image?

You can, but it is usually a poor choice. A dedicated 1200×630 visual with readable branding and context performs much better.

What is the safest default setup for a blog article?

Use: title, meta description, canonical, og:title, og:type=article, og:description, og:url, og:image, og:image:width, og:image:height, og:image:alt, og:site_name, twitter:card, twitter:title, twitter:description, twitter:image, and JSON-LD.