We use Google Analytics cookies to understand which pages and tools are useful and improve the site. Privacy policy.

Next.js SEO

How should generated Open Graph images use alt text?

By bumpit Editorial2026-07-264 min read

Describe the information represented by the preview image without repeating the full title mechanically. Keep essential guidance in page text, not only inside artwork.

Written for next.js designers and developers generating per-article social images with metadata file conventions.

Key facts

  • Next.js Open Graph image metadata can provide image files and associated alt text conventions.
  • Open Graph metadata and page image alt text serve related but not identical consumers.
  • Text embedded only in a social image is not a substitute for accessible HTML content.

A useful rule: make each important claim understandable and verifiable without requiring the reader to reconstruct your meaning from the rest of the page.

What should the alt text describe?

Describe the image's meaningful visual content and its relationship to the page. For a diagram, name the process or comparison shown. For a branded editorial card, state that it is a visual title card for the named guide when that is the relevant information. Avoid copying a long headline word for word if the surrounding preview already announces it, and avoid phrases such as “image of” unless the medium matters. The text should help a user understand what the unavailable or nonvisual asset represents.

  • Describe meaning before decoration.
  • Keep wording concise and page-specific.
  • Avoid keyword lists and duplicated boilerplate.

Sources: 1, 2

Where does Next.js get Open Graph alt text?

Next.js supports file-based Open Graph image conventions and associated alt text files, while metadata objects can define image entries with URLs, dimensions, types, and alt values. The exact API depends on the route and installed framework version. Choose one ownership model to prevent a generated image and inherited metadata object from competing. Inspect the rendered `og:image` and `og:image:alt` tags on the production page. A correctly named source file is not proof that nested layouts emitted the intended final value.

  • Use one source of truth per route image.
  • Test inherited and page-specific metadata.
  • Inspect final tags after production build.

Sources: 1

Should image text repeat the page title?

A short title on the image can help a social card stand alone, but the design should not depend on tiny text or include claims absent from the page. Keep the subject consistent with the HTML title, H1, and `og:title`. Long generated titles need line limits, safe areas, and graceful truncation that does not change meaning. If the article has a chart or original evidence, a preview based on that visual may communicate more than a generic title card. Essential dates, warnings, and instructions must remain in HTML.

  • Test long titles and narrow preview crops.
  • Keep claims consistent across image and page.
  • Put essential information in accessible text.

Sources: 1, 2

How should generated assets be delivered?

Use stable absolute production URLs, correct image content types, supported dimensions, and caching that changes when the underlying article image changes. The asset must be publicly fetchable without cookies or browser challenges. Avoid expiring signed URLs and preview hosts. Keep generation deterministic so the same article does not produce a visually different card on every request. If generation fails, provide a relevant fallback rather than a broken response. Test the image URL directly and through representative preview clients.

  • Verify public anonymous access.
  • Use deterministic inputs and cache keys.
  • Provide a page-relevant fallback image.

Sources: 1

What belongs in visual metadata QA?

For representative articles, fetch the HTML, extract image URL and alt text, request the asset, and verify status, type, dimensions, and origin. Render cards at common aspect ratios and inspect title wrapping, contrast, safe areas, and brand consistency. Compare the image with the visible article and remove unsupported claims. Test an article without custom artwork and one with a long title. Preserve screenshots with the release so regressions in font loading or image generation can be identified quickly. Recheck previews after template changes.

  • Automate response and metadata checks.
  • Visually inspect common crops.
  • Include failure and fallback cases.

Sources: 1, 2

Put it to work

Find the highest-impact fix on your site.

Verify Open Graph image URLs, alt text, dimensions, public responses, and alignment with the article.

Audit social image metadata

Sources

  1. 1.Next.js documentation: Open Graph image metadata filesChecked 2026-07-26
  2. 2.Google Search Central: Article structured dataChecked 2026-07-26
Published 2026-07-26 · Last reviewed 2026-07-26 · Review due 2026-10-26Search systems and content quality