Link previews blank or wrong after launch? Fix your Open Graph tags

You launch, paste your link into WhatsApp, Slack, LinkedIn or X, and the preview is wrong. It shows no image, a generic title like "Vite + React", or the name of your builder instead of your product. Nothing is technically broken, the site loads fine, but every share now looks unfinished, and fewer people click.

This is very common with apps built in Lovable, Bolt, Replit, v0 and Cursor, because most of them start as single-page apps where the page content is filled in by JavaScript after load.

The symptom

  • Shared links show a blank grey box or no image at all.
  • The title or description is a template default, or the same on every page.
  • You fixed the tags, but the old preview keeps showing.

The cause

Link previews come from Open Graph and Twitter card tags in the page's <head>, such as og:title, og:description, og:image and twitter:card. The bots that build previews fetch the raw HTML your server sends. Most of them do not run JavaScript.

In a single-page app, the server sends the same small index.html for every URL. If your title and image are set later by a React helper, the preview bot never sees them. It only sees whatever was hard-coded in index.html, which is often the starter template's defaults.

Three other things cause the same symptom:

  • Relative image paths. og:image must be a full URL like https://yourdomain.com/og.png. A path like /og.png is often ignored.
  • Images the bot can't load. The image sits behind a login, returns a 404 after a rebuild changed its file name, is very large, or is in a format some platforms skip.
  • Caching. Platforms cache previews. After you fix the tags, the old preview can stick around until the cache is refreshed.

Step-by-step diagnosis

  1. Look at the raw HTML, not the page. Run curl -s https://yourdomain.com/ | grep -i "og:", or open view-source in the browser (not the Elements panel, which shows the page after JavaScript ran). If the og tags are missing or generic there, that is what the bots see.
  2. Check a deep page too. Try /pricing or a blog post. If it shows the exact same tags as the home page, your per-page tags only exist in JavaScript.
  3. Open the image URL directly in a private window. It should load without signing in, over https, and return a real image.
  4. Use the platforms' own tools. Facebook's Sharing Debugger and LinkedIn's Post Inspector show what their bots fetched, list missing tags, and let you force a fresh scrape.

Fixes per builder or host

Lovable, Bolt and other Vite single-page apps

Put solid default tags straight into index.html: your real product title, a one-line description, an absolute og:image URL and twitter:card set to summary_large_image. Delete the template's leftover title and favicon references.

Keep the share image in the public folder with a fixed name like og.png, so it doesn't get a new hashed file name on every build. A common recommendation is about 1200 by 630 pixels in PNG or JPG, kept reasonably small.

If you need different previews per page, plain client-side tags won't do it. You need pre-rendering or server rendering for those routes, or a host feature that injects tags at the edge. Ask your builder's AI to add pre-rendering for the specific routes you share, then check the raw HTML again.

v0 and Cursor projects on Next.js

Next.js renders tags on the server, so use its metadata API (export const metadata or generateMetadata in the App Router) rather than setting document.title in a client component. Set metadataBase to your production domain so image URLs become absolute instead of pointing at localhost or a preview URL.

Replit

If your app is served by your own Express or Flask server, you can add the tags to the HTML template, or fill them per route on the server before the page is sent. Make sure the image URL uses your custom domain, not a temporary dev URL.

How to verify

  • curl the home page and one deep page and confirm the og tags are in the raw HTML with your real text.
  • Open the og:image URL in a private window and confirm it loads.
  • Run the link through Facebook's Sharing Debugger and LinkedIn's Post Inspector and ask them to scrape again.
  • Paste the link in a fresh chat. Some apps cache old previews, so adding a harmless query string like ?v=2 shows you the new version.

Prevention

  • Set real default tags in index.html or your root layout on day one, not after launch.
  • Always use absolute https URLs for og:image and og:url.
  • Keep the share image at a stable path that builds don't rename.
  • When your builder regenerates the head or layout, re-check the raw HTML, since AI edits sometimes reset it to defaults.

Previews are one of many small things that quietly go wrong after a deploy. Checking the basics regularly catches them before your customers do.

Run the free 30-second check

Run the free 30-second check

← All posts

FlowCanary on SaaSHub