Render meta tags with empty content
Answered
nevz posted this in #help-forum
nevzOP
Is there a way to render the meta tag when the value is an empty string? It does not render anything if the field is empty e.g.
meta tag for description here will not render here because it's an empty string, I'm expecting to just have an empty content like <meta content="" name="description">
Asked in
export function generateMetadata() {
return { title: 'Shows up', description: '' }
}
meta tag for description here will not render here because it's an empty string, I'm expecting to just have an empty content like <meta content="" name="description">
Asked in
gpt-help
the solution was to add a whitespace, but not sure why can't we just render with an empty string for content
5 Replies
What's the point of having a description if it's gonna be blank
Answer
You should have one if you want good SEO
@nevz
nevzOP
well it's not really going to be hard coded, but just wondering if there's a workaround, but you definitely gave a good point, I remember some site audits showing warnings for empty content, but still it makes sense to me to just render the tag
nevzOP
thanks anyway, since I tested just adding it in JSX doesn't really solve it