ScreenshotNeo

BlogHow-to

How to Debug LinkedIn Open Graph Previews

Fix stale or incorrect LinkedIn previews by checking Open Graph tags, validating image access, and refreshing the URL in Post Inspector.

By the ScreenshotNeo team1 October 20267 min read

When LinkedIn shows an old, missing, or incorrect link preview, debug the page LinkedIn fetches rather than the page you see after JavaScript runs. Check the Open Graph tags in the initial HTML response, verify that the image URL is publicly reachable, refresh the URL in LinkedIn Post Inspector, and then create a new post.

1. Check the Open Graph tags first

Open Graph metadata lives in the document’s <head>. The protocol defines four required properties for every page: og:title, og:type, og:image, and og:url. og:description is optional but recommended. See the Open Graph Protocol.

<head>
  <meta property="og:title" content="How to Debug LinkedIn Open Graph Previews">
  <meta property="og:type" content="article">
  <meta property="og:url" content="https://example.com/guides/linkedin-previews">
  <meta property="og:image" content="https://example.com/images/linkedin-preview.png">
  <meta property="og:description" content="A practical guide to fixing stale or incorrect LinkedIn link cards.">
</head>

What to verify

  • Title: og:title contains the title you want to share.
  • Description: og:description summarizes the page and is not empty or accidentally copied from another template.
  • Canonical URL: og:url is the intended canonical URL, including the correct protocol, host, path, and meaningful query handling.
  • Image URL: og:image is an absolute URL to the intended image.
  • Initial response: the tags are present in the HTML returned by the server, not only after client-side JavaScript executes.

View the page source or fetch the raw response. Browser developer tools can show a later DOM state, so compare that with the original HTML response when the values disagree.

2. Confirm that the image can be fetched

Copy the complete value of og:image and open it in a private browser window or another unauthenticated client. The response should be the intended image, not a login page, error page, redirect chain, or unrelated asset. This is a practical troubleshooting check described by the LinkedIn Post Preview troubleshooting guide, rather than a documented LinkedIn requirement.

curl -I -L 'https://example.com/images/linkedin-preview.png'

Check the final response and content type. If the URL requires a session, is blocked by access controls, or returns an error, publish the image at a directly reachable URL and update og:image.

3. Compare server HTML with the browser DOM

If the tags appear in the browser inspector but not in the raw response, your application may be inserting metadata client-side. The third-party troubleshooting guide recommends making the metadata available in the server response. Treat this as a diagnostic recommendation: the reviewed LinkedIn Help page does not document whether LinkedIn’s crawler executes JavaScript.

curl -L 'https://example.com/guides/linkedin-previews' | sed -n '/<head>/, /<\/head>/p'

For server-rendered frameworks, generate the tags during the request that returns the page. For static sites, confirm the generated HTML file contains the final values before deployment.

4. Refresh the URL in LinkedIn Post Inspector

  1. Open LinkedIn Post Inspector.
  2. Enter the page URL you plan to share.
  3. Review the title, description, and image shown by the inspector.
  4. If any value is wrong, fix the page and run the inspection again.
  5. After the inspector is correct, compose a new LinkedIn post with the URL and review its preview before publishing.

LinkedIn’s official Help page says the refresh affects new posts. Existing posts keep their previous preview: “The changes you make will only affect the URL’s preview image and information for new posts that include it. The preview for any existing posts with this URL will remain the same.”

5. Diagnose the likely cause in order

Symptom Likely cause What to do
Old image Cached preview or metadata still points to an earlier asset Confirm the current og:image, inspect the URL, then refresh in Post Inspector and test a new post.
No image Missing tag, inaccessible image URL, or an image response that is not the intended asset Add og:image, use an absolute public URL, and verify the response without logging in.
Wrong title or description Incorrect tag values or tags from another page template Inspect the raw HTML and correct og:title or og:description.
Browser shows correct tags but LinkedIn does not Tags are added only after JavaScript runs, or LinkedIn has stale data Put metadata in the initial response, then run Post Inspector again.
New post still shows old data The URL was not refreshed after the change, or the post was composed before the refresh Run Post Inspector after deployment and start a new post.

6. A repeatable debugging checklist

  • Fetch the exact URL you will share.
  • Confirm og:title, og:type, og:image, and og:url are in the HTML <head>.
  • Add or verify og:description.
  • Ensure og:url is the intended canonical URL.
  • Open the complete image URL without site authentication.
  • Check that the raw response contains the same values your browser displays.
  • Deploy the correction.
  • Run the URL through Post Inspector.
  • Compose a new post and verify its card.

7. Implementation examples

Static HTML

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta property="og:title" content="How to Debug LinkedIn Open Graph Previews">
  <meta property="og:type" content="article">
  <meta property="og:url" content="https://example.com/guides/linkedin-previews">
  <meta property="og:image" content="https://example.com/images/linkedin-preview.png">
  <meta property="og:description" content="A practical guide to fixing stale or incorrect LinkedIn link cards.">
  <title>How to Debug LinkedIn Open Graph Previews</title>
</head>
<body>...</body>
</html>

Inspecting with cURL

curl -L --silent 'https://example.com/guides/linkedin-previews' \
  | grep -E 'property="og:(title|type|url|image|description)"'

Inspecting with Python

import requests
from bs4 import BeautifulSoup

url = "https://example.com/guides/linkedin-previews"
response = requests.get(url, timeout=30)
response.raise_for_status()
soup = BeautifulSoup(response.text, "html.parser")
for name in ("title", "type", "url", "image", "description"):
    tag = soup.find("meta", property=f"og:{name}")
    print(f"og:{name} = {tag.get('content') if tag else 'MISSING'}")

Inspecting with Node.js

const url = 'https://example.com/guides/linkedin-previews';
const html = await (await fetch(url)).text();
for (const name of ['title', 'type', 'url', 'image', 'description']) {
  const match = html.match(new RegExp(`<meta[^>]+property=["']og:${name}["'][^>]+content=["']([^"']+)["']`, 'i'));
  console.log(`og:${name} = ${match ? match[1] : 'MISSING'}`);
}

8. Or skip the browser setup

If you need a reliable rendered image of the page while debugging the card, ScreenshotNeo provides a website screenshot API and MCP server. It accepts one GET request and returns a PNG, JPEG, WebP, or PDF. Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

See the ScreenshotNeo API documentation for all capture options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' }); const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Relevant capture controls include full-page screenshots with lazy images loaded, a chosen CSS element, custom CSS or JavaScript, waits for a selector or network idle, custom headers and cookies, user-agent and authorization values, timezone and geolocation, hidden selectors, caching with a chosen TTL, image resizing, and PDF page settings. Use these to reproduce the page state you need to inspect; keep the Open Graph debugging decision based on the raw HTML and LinkedIn Post Inspector.

There are 1,000 free screenshots each month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan. Create a free ScreenshotNeo account.

9. Performance, reliability, and cost considerations

  • Inspect once, then recheck: Fetch the page and image directly before repeatedly refreshing previews.
  • Use stable URLs: Keep the canonical page and image URLs consistent so you can tell a metadata change from stale preview data.
  • Separate rendering from metadata: A screenshot can show what a browser renders, but it does not prove that the Open Graph tags were present in the initial response.
  • Control capture cost: ScreenshotNeo bills only clean shots; bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing. Caching with a TTL you choose can avoid repeated captures.
  • Automate safely: For many pages, use ScreenshotNeo’s bulk capture (up to 100 URLs per call), asynchronous jobs with signed webhooks, and usage API. Verify the returned verdict and billing headers when recording results.

10. FAQ

Does Post Inspector edit an already-published LinkedIn post?

No. LinkedIn says refreshed information applies to new posts; existing post previews remain unchanged.

Are Open Graph tags required for LinkedIn?

The Open Graph Protocol defines four required properties for every page: og:title, og:type, og:image, and og:url. LinkedIn-specific preview behavior can vary, so verify the result in Post Inspector.

Why does view source matter?

It shows the HTML response before browser scripts modify the DOM. If metadata exists only after JavaScript runs, the initial response may not contain the values you intended to share.

How long does LinkedIn cache a preview?

The research used for this guide does not verify a precise cache lifetime. Refresh with Post Inspector after deployment and test a new post.

Can a screenshot prove that LinkedIn will show the same card?

No. A screenshot helps inspect the rendered page, while the card depends on the metadata and image URL LinkedIn retrieves. Use both the raw HTML checks and Post Inspector.