Worked example This website, built with AI coding tools
Link previews that quietly lost their image
Everything looked right in the browser. Shared on LinkedIn, half the pages had no image or the wrong title. A metadata rule in Next.js, fixed in one place.
- Next.js, Open Graph metadata
- Not a client project: a real problem from this site's own code
What happened
Every page on this site sets its own title and description for search results and for the preview you see when a link is shared. In the browser, every page looked right.
01
The problem
Shared on LinkedIn or in a chat, the services page and the AI Code Rescue page showed no preview image, while the home page did. Product and work pages showed the site's general title instead of their own, and had no canonical URL.
02
The investigation
- Fetched the HTML of each page and read the meta tags, the way LinkedIn's crawler does. Only the home page had an og:image.
- Compared the pages that worked with the ones that didn't. The pages without an image defined their own Open Graph metadata. The pages with the wrong title defined none, and inherited the home page's.
03
The root cause
In Next.js, a page that sets its own Open Graph metadata replaces the inherited set completely, image included. A page that sets none inherits all of it, title included. Both mistakes are invisible in the browser.
04
The decisions
- Fixed it in one place: a small helper that gives every page its own title, description, canonical URL and share image, instead of patching pages one by one.
- Checked the result in the HTML, not in the browser, because the HTML is what crawlers read.
05
The fix
Every page now builds its metadata with the same helper: services, AI Code Rescue, contact, the blog and its posts, and every product and work page.
06
How it was checked
- Each page's HTML now has its own og:title, an og:image and a canonical URL.
What this means for your appAI-built code is often right where you look and wrong where you don't. Link previews, emails and search results are worth checking on purpose.
Stuck on something like this? Tell me what your app should do and what goes wrong. I'll tell you what I would check first.
Get your app fixedAnother worked example: A contact form that looked fine but couldn't deliver.