Updated
How link previews work
When you share a URL, the platform sends its own crawler to fetch the page and reads the Open Graph tags in the HTML head. The og:image tag names the picture, og:title and og:description supply the text. X also reads its own twitter:card and twitter:image tags and falls back to Open Graph when they are missing.
The crawler does not run your JavaScript and does not log in. Whatever it finds in the raw HTML of that first response is all it has to work with.
Check what the platforms actually see
Before changing anything, look at the tags the way a crawler does. Viewing the page in your browser is not enough, because the browser shows you the page after scripts have run.
The five usual causes
- The og:image tag is missing. Add a meta tag with property og:image and the image URL as its content inside the head of the page.
- The image URL is relative. Crawlers need an absolute URL that starts with https:// — a path like /images/share.png is not enough.
- The image is not publicly reachable. It returns a 404, sits behind a login, or is blocked for bots by a firewall or robots.txt rule.
- The tag is added by JavaScript. If your framework injects meta tags in the browser, crawlers never see them. Render them on the server or at build time.
- The image is the wrong size or too heavy. Use 1200×630 pixels, PNG or JPG, and keep it well under 5 MB. Very small images are ignored or shown as a tiny thumbnail.
Clear the cached preview
Platforms cache previews, sometimes for days. After fixing the tag you will often still see the old result. Re-scrape the URL with Facebook's Sharing Debugger or LinkedIn's Post Inspector to force a fresh fetch.
Where there is no such tool, change the image URL itself — renaming the file or adding a query string such as ?v=2 makes the platform treat it as a new image. In chat apps, a preview that was already posted will not update; send the link again in a new message.
Confirm the rest of the head
A preview is more than the picture. If the title or description in the card looks wrong, check the full set of meta tags on the page — a missing og:title means the platform falls back to the title tag, which may be longer than the card can show.