What a Link Preview Is
A link preview is the card that appears when you paste a URL into a post or a chat: an image, a title, sometimes a description and the site name. People also call it a link card, a rich preview or an unfurl. The page controls what goes in it, not the person sharing.
How Apps Build a Link Preview
- You paste a URL. The app sends its crawler to fetch the page.
- The crawler reads the HTML. It doesn't run JavaScript, so it only sees what your server sends.
- It looks for Open Graph tags:
og:title,og:description,og:image. X also reads twitter: tags. - It downloads the image and saves everything in a cache.
- Later shares of the same URL reuse the cache. That's why changes don't show up right away.
Which Crawler Each App Uses
If previews work in one app and not another, check your server logs or firewall for these user agents.
| App | User agent contains | Tags it reads |
|---|---|---|
| Facebook, Instagram, Messenger, Threads | facebookexternalhit | Open Graph |
| X (Twitter) | Twitterbot | twitter: tags, then Open Graph |
LinkedInBot | Open Graph | |
| Slack | Slackbot-LinkExpanding | Open Graph, twitter: tags, oEmbed |
| Discord | Discordbot | Open Graph, twitter: tags, oEmbed |
WhatsApp | Open Graph | |
| Telegram | TelegramBot | Open Graph |
| iMessage | facebookexternalhit and Twitterbot | Open Graph. The sender's phone does the fetching. |
Why a Link Preview Isn't Showing
- The page has no Open Graph tags. Run it through the checker above. Missing tags are listed first.
- The tags are added by JavaScript. Single-page apps do this a lot. Render the tags on the server.
- The crawler is blocked. robots.txt, a login wall, a firewall rule or bot protection will all do it.
- The image can't be used. It's too small, too heavy, an SVG, or the URL is relative.
- The page is slow. Crawlers give up after a few seconds.
- The app cached an older version. Refresh it with the table below.
How to Refresh a Cached Link Preview
| App | How to refresh |
|---|---|
| Use Scrape Again in Meta's Sharing Debugger. Steps are on the Facebook debugger page. | |
| Inspect the URL in Post Inspector. Steps are on the LinkedIn Post Inspector page. | |
| X (Twitter) | No refresh tool. X re-fetches about once a week. Add ?v=2 to the link to force it. |
| Slack | Wait about 30 minutes, or add a query string to the link. |
| Discord | Add a query string to the link. |
| Add a query string to the link. | |
| Telegram | Send the link to @WebpageBot. |
Frequently Asked Questions
What tags do I need for a link preview?
Four cover almost every app: og:title, og:description, og:image and og:url. Add twitter:card set to summary_large_image so X shows the large image.
Why does my link preview look different in each app?
Every app reads the same tags but lays the card out its own way. Some crop the image to a square, some hide the description, and each one caches the page at a different time, so one app can be showing an older version.
Can I preview a page on localhost?
No. The checker can only fetch public URLs. Put the page on a staging URL, or open a temporary tunnel with a tool like ngrok or cloudflared and paste that address.
How do I change the image in a link preview?
Change the og:image tag on the page to the new image URL, then refresh each app's cache. Giving the new image a different file name helps, because several apps cache images by URL.