Next.js metadata.title Appears Twice Due to layout's title.template
機械翻訳 / Machine-translated
機械翻訳 / Machine-translated
In Next.js App Router, when a parent layout sets title.template and a child page's metadata.title already includes the same suffix, the entire string gets substituted into %s, causing the suffix to appear twice in the title. The fix is to remove the suffix from the child page's title and let the layout's template handle appending it.
When a parent layout has title.template configured, writing a string that already contains the same suffix in a child page's metadata.title will cause that suffix to appear twice in the title tag. This happens because the template does not inspect the string returned by the child page — it simply substitutes it as-is into %s. The fix is to remove the suffix from the child page's title and delegate the appending entirely to the layout-side template.
A detailed walkthrough, how to verify the behavior, and frequently asked questions are summarized in the original article.
→ Next.js metadata.title Appears Twice Due to layout's title.template|Rebounder Tech Blog