How to fix missing og description on Next.js (Headless)
Add an og:description meta tag to every page so that social media platforms display a compelling, accurate preview when your pages are shared.
Steps for Next.js (Headless)
- Identify whether your project uses the App Router (`app/`) or Pages Router (`pages/`). The fix differs slightly between them — both approaches are covered in the snippet below.
- App Router: Open (or create) the `generateMetadata` export in every `app/**/page.tsx` (and `app/layout.tsx` for site-wide defaults). Add an `openGraph.description` field that is populated from your page/product data fetched at build or request time.
- Pages Router: In every `pages/*/.tsx` file, import `next/head` and add a `<meta property='og:description' content={description} />` tag inside the `<Head>` component, using the page's fetched data for the value.
- Create a shared `getSeoDescription(text: string, maxLen = 160)` utility in `lib/seo.ts` that trims raw copy to a safe length, strips HTML tags, and falls back to a site-wide default — then call it from every page's metadata logic.
- For dynamic routes (e.g. `app/products/[slug]/page.tsx`), fetch the product/collection description inside `generateMetadata` and pass it through `getSeoDescription` before assigning it to `openGraph.description`.
- Run `npx next build` and inspect the rendered HTML (`<meta property='og:description'>`) or use the Open Graph debugger (https://developers.facebook.com/tools/debug/) to confirm the tag appears on every page type.
What is missing og description?
The og:description tag is a small piece of HTML code placed in the `<head>` of your page that tells social networks — Facebook, Pinterest, LinkedIn, X (Twitter), WhatsApp, and others — what text to show beneath your page title when someone shares your link. It is part of the Open Graph protocol, a standard created so websites can control exactly how their content appears in social previews. Without it, social platforms will either grab random text from your page or show nothing at all, resulting in ugly, unhelpful link previews. It is separate from (but related to) your regular HTML meta description.
When a customer or influencer shares your product or collection page on social media, the preview card is often the first impression a potential buyer sees — before they even visit your store. A missing og:description means the platform guesses what to show, often pulling in irrelevant text like navigation labels, price fragments, or nothing at all, which dramatically reduces click-through rates. Rich, controlled social previews directly drive referral traffic and conversions, especially for product launches, promotions, and influencer marketing. There is also an indirect SEO benefit: higher engagement signals from social traffic can reinforce the authority of your pages in search rankings.
See the complete Missing og description guide for every platform and the full background.
Not sure if your Next.js (Headless) store has this?
Run a free SEOLZ scan — we’ll find missing og description and every other issue across your whole site.
Scan my site free