← All articles
Next.jsметаданныеcanonical

Next.js Metadata API: canonical, hreflang and OG

One place for titles, alternates and social cards — without duplicate URLs in search.

7 min

App Router metadata via metadata or generateMetadata. Mistakes here create duplicate listings when Google sees the same page on multiple URLs.

Canonical and hreflang

  • alternates.canonical points to the clean final URL
  • alternates.languages links RU/EN with x-default
  • Consistent trailing-slash policy sitewide

We centralize buildPageMetadata(locale, path, title, description) and use generateMetadata for dynamic blog and service routes.

Read also

Discuss your project