What is the correct way to generate SEO metadata in t3 app

I have been using <Head> tag in index.tsx file to add all my page meta tags, but it turns out it cannot show this metadata in search engines. So what is the correct way to add the meta tags in t3 app.
9 Replies
choco
choco•11mo ago
you can add it in _app.js if you want to be it in all your routes.
johnversus
johnversus•11mo ago
I only have one index route in my app. Do I still need it in _app.js? The data in my index.tsx seems to be applied or rendered only when opened the site on browser. search engines, crawlers are not able to read my metadata.
choco
choco•11mo ago
No, if you have only index route you dont have to use _app.js.
I have been using <Head> tag in index.tsx file to add all my page meta tags, but it turns
i misread that part Head component is supposed to add metatags tho could you please download one of the chrome extensions that check seo of your site "META SEO inspector" as an example
johnversus
johnversus•11mo ago
Thanks for the extension but I think this extension is only reading the site after it is rendered. As per the extension I have all the tags but if I post the link in any app like discord or slack they dont recognise the app metadata.
choco
choco•11mo ago
@johnversusthe only reasone that i see as junior developer and not very good programmer is that your site has not robot.txt and site map
choco
choco•11mo ago
this is my site and it doesnt have open graph meta tags https://checkapi.app
Check API | Request Tool | Analyze Server Response Data
Check API - Website to check the data from the API response. The site will help control and test your back-end
choco
choco•11mo ago
but it has robot.txt and sitemap. Also i have added my site in google console but honesly it may not be an issue it is not supposed to be an issue
johnversus
johnversus•11mo ago
Thanks for the suggestion. I tried adding robots and sitemap now. it is still dead, no change. https://nimbleuikit-website.vercel.app/ Do you know if it is possible to use Metadata export feature from next 14 app folder in t3 app? I tried using export metadata in a different project. that works like magic.