Next 13 - error multiples <title> / <meta> on tag <head>
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 Binaries: Node: 16.13.1 npm: 8.19.2 Yarn: 1.22.19 pnpm: N/A Relevant packages: next: 13.0.0 eslint-config-next: 13.0.0 react: 18.2.0 react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next dev
Describe the Bug
When a create files
head.js :
export default async function Head({ params }) {
return (
<>
<title>Title head</title>
<meta name="description" content="Generated by head" />
</>
);
}
layout.js :
export default async function RootLayout({ children }) {
return (
<html lang="en">
<head>
<title>Title layout</title>
<meta name="description" content="Generated by layout" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
</head>
<body>{children}</body>
</html>
);
}
Tags < title > and < meta > are not deleted, just add another tags in html structure :

I tried with async function and normal functions,
Thank’s
Expected Behavior
<title> and <meta> tag replacementLink to reproduction
https://github.com/john-dufrene-dev/test-nextjs13
To Reproduce
npm run dev with this repository
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:12 (3 by maintainers)
Top Results From Across the Web
next/head - Next.js
title , meta or any other elements (e.g. script ) need to be contained as direct children of the Head element, or wrapped...
Read more >How to Add Title and Meta Tags for Each Page in Next.js
So here in this article, we will discuss the steps to add title and meta tags for each page in a next.js app....
Read more >React SEO with Next.js - Dynamic SEO Meta Tags Tutorial
We'll walk through how Next.js can take your SPA's SEO to another level ... metadata 05: 13 - Adding the Head component to...
Read more >Explanation of the error messages for the W3C Markup Validator
This error usually indicates that you have failed to add a closing quotation mark on a previous attribute value (so the attribute value...
Read more >How To Use Templates in a Flask Application - DigitalOcean
Next, you'll have to create the index.html template file in a directory ... lang="en"> <head> <meta charset="UTF-8"> <title> {% block title ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Updated today to NextJS 13.0.3, but the issue is still present, all my schema.org meta tags are moved from the body to the page head creating a mess of multiple titles and descriptions on the posts list page.
komzweb, I’m doing more/less the same now, but previously I simply accessed the post title in layout via
children.props.title
It was a much more convenient way instead of creating a separate head file for each post. I’m not using API for posts (they are simply stored in js files, because of better SEO optimization possibilities, which are not available when JSON/markdown is in use). Would be nice if someone from dev tell here how to access children’s post title from the layout, if possible. As from the docs passing props and vice versa is not possible.