React app link preview not working because Open Graph tags are missing

Link preview crawlers read the HTML your server sends and do not run JavaScript. In a client-only React app, tags from React Helmet or React 19 <meta> only exist after the app loads, so crawlers see the shared index.html. Prerender or server render each route so og:title, og:description and og:image are in the first response.

Last updated

linkpreview.app
Meta Tag checker
framer.com
og:title
og:image
x.comRefresh
Launch week: everything new
From yoursite.com
index.html<head>
+<meta property="og:image"
+ content="/og/launch.png">
Quick fix

  1. Open the URL in the meta tag checker or run curl -s https://www.framer.com/ | grep og: on your own page. If no og: tags come back, crawlers cannot see them.

  2. Prerender or server render every route you share, for example with React Router framework mode or Next.js.

  3. If you cannot do that yet, put site-wide og: tags in index.html so every link gets at least a default card.

  4. Deploy, then share the URL again with ?v=2 so apps fetch it as a new link.

Why React previews break

  • The app renders in the browser. A Vite or Create React App build ships one index.html with an empty root element, and every route returns that same file.

  • React Helmet and react-helmet-async change the head after JavaScript runs. They only reach crawlers when the page is also rendered on the server.

  • React 19 moves <meta> tags into the document head for you, but in a client-only app that still happens in the browser.

  • The tags depend on an API call. Crawlers do not wait for fetches or loaders that run in the browser.

  • The image URL is relative, or points to localhost or a preview domain.

LinkPreview meta tag checker result for example.com, showing missing Open Graph images as empty placeholders in Google, X, and Slack previews.

How to fix it

  1. Check what crawlers get. Use View Source, not the Elements panel, or run curl -s on the URL and search for og:.

  2. Choose a setup that outputs HTML per route: React Router in framework mode, Next.js, or another server rendering or static build.

  3. For a known list of pages, prerender at build time. React Router’s prerender option writes an HTML file for each path you list, dynamic ones included.

  4. For pages built from live data, render on the server or at the edge and write the tags into the HTML before it is sent.

  5. Use absolute https:// URLs for og:image and og:url.

  6. Deploy, check the live URL in the meta tag checker, then share it again.

React documentation for the built-in meta component, showing how to render document metadata in the document head.

Tags to put in the server HTML

  • og:title, og:description, og:image and og:url

  • twitter:card set to summary_large_image for a large card on X

  • One set per page. Remove the defaults from index.html when a route renders its own tags, so crawlers do not read the wrong set.

LinkPreview meta tag checker result for react.dev, showing a complete React Open Graph image, title, and description in Google, X, and Slack previews.

Discord’s documentation says the tags must be in the HTML your server sends and that no code is executed, and other preview crawlers behave the same way. Google can render JavaScript, so a page can look fine in Google and still show no preview in chat apps.

Image size rules

Use a 1200 x 630 px JPEG or PNG with an absolute https URL. Keep it under 5 MB for X and small enough for WhatsApp. Check the file with the OG image size checker.

How to force a refresh

Apps cache a preview per URL, so fixing the build does not update links that were already shared. After you deploy, confirm the tags with the meta tag checker, then use the refresh tool for each app, or share the URL with a query string such as https://www.framer.com/?v=2.

Sources

FAQ

Why does React Helmet not fix my link preview?

Helmet updates the head in the browser after JavaScript runs. Crawlers read the first HTML response and leave, so Helmet only helps when the page is also rendered on the server.

Do React 19 meta tags work for link previews?

Only when the page is server rendered or prerendered. In a client-only app React adds them in the browser, and preview crawlers do not run that code.

Can a Vite React app have a different og:image per route?

Not as a plain single-page build, because every route returns the same index.html. Prerender the routes, render them on the server, or inject the tags at the edge.

Check your page, then refresh the preview

Paste your URL into the free checker to see the exact tags each app reads. Once the tags are right, use the refresh tool to clear the old preview.