Multilingual SEO with Next.js
A translated page needs its own URL that you can open directly. A shared route registry keeps the language switcher, metadata, and sitemap aligned as you add translations.
Give each language its own route
Record a stable content key, the German and English URLs, and translated titles, descriptions, and body copy for each page. The language switcher can look up the same key in the other language even if the two paths use different words.
For a static export, dynamic detail routes can supply their slugs through generateStaticParams. Next.js generates HTML for the known routes during the build, so readers can open each translation directly at its own address.
Set canonicals and reciprocal language links
Point the canonical tag of each distinct translation to its own final URL. Include the same complete set of absolute hreflang URLs on both pages. If German is the default language, x-default can also point to the German page.
The example shows the tags for the German page. On the English page, the canonical changes to the English URL. All three language references stay the same. With the App Router, generate these tags through alternates.canonical and alternates.languages.
<link rel="canonical" href="https://example.com/leistungen/webentwicklung/">
<link rel="alternate" hreflang="de" href="https://example.com/leistungen/webentwicklung/">
<link rel="alternate" hreflang="en" href="https://example.com/en/services/web-development/">
<link rel="alternate" hreflang="x-default" href="https://example.com/leistungen/webentwicklung/">Build the sitemap from the route registry
Use app/sitemap.ts to generate an entry for each language version from the same registry at build time. List the final, indexable URLs with their protocol and consistent use of trailing slashes. Google treats HTML and XML sitemap language annotations as equivalent. If you use both formats, check that they list the same language pairs.
Check the published export
Fetch each translation directly. Check for HTTP 200, translated content in the HTML, the correct canonical, and reciprocal language links. Then try the visible language switcher on a detail page and check that it opens the same content in the other language.
Google Search Console’s URL Inspection tool shows which canonical Google selected after crawling. Re-run the HTTP checks as soon as you deploy. Google updates its data when it next processes the URL.