Next.js Discord

Discord Forum
After you done that do the following:1. Check if everything is online: https://validator.schema.org/2. Check if your page is indexed: https://support.google.com/webmasters/answer/90122893. Let google recrawl your page: https://developers.google.com/search/docs/crawling-indexing/ask-google-to-recrawl4. Check if google got your new script tag: https://nextjs-forum.com/post/1324434195933823089#message-1325383963056934933 and https://nextjs-forum.com/post/1324434195933823089#message-13253842536929731075. Validate that HTML with https://validator.schema.org/Google made a whole guide for that: https://developers.google.com/search/docs/appearance/site-names","url":"https://nextjs-forum.com/post/1324434195933823089#message-1325385890536624228","dateCreated":"2025-01-05T08:50:20.783Z","author":{"@type":"Person","name":"B33fb0n3"},"upvoteCount":1}}}

How to set Site name so in google it should appear not the Domain Name.

Answered
Yacare Caiman posted this in #help-forum
Open in Discord
Yacare CaimanOP
I want to know why the domain name is appearing on the title instead of my Site Title AI Flavored.
Answered by B33fb0n3
right now it's not changed yet. Maybe in the future. You done now everything you can do.

To conclude all steps that we've made:
You need to add this kind of script:
<script type="application/ld+json">
    {
      "@context" : "https://schema.org",
      "@type" : "WebSite",
      "name" : "Example Company",
      "alternateName" : "EC",
      "url" : "https://example.com/"
    }
  </script>

After you done that do the following:
1. Check if everything is online: https://validator.schema.org/
2. Check if your page is indexed: https://support.google.com/webmasters/answer/9012289
3. Let google recrawl your page: https://developers.google.com/search/docs/crawling-indexing/ask-google-to-recrawl
4. Check if google got your new script tag: https://nextjs-forum.com/post/1324434195933823089#message-1325383963056934933 and https://nextjs-forum.com/post/1324434195933823089#message-1325384253692973107
5. Validate that HTML with https://validator.schema.org/

Google made a whole guide for that: https://developers.google.com/search/docs/appearance/site-names
View full answer

78 Replies

@Yacare Caiman I want to know why the domain name is appearing on the title instead of my Site Title AI Flavored.
Try to add a og:site_name meta tag to your head (og:site_name is not the same as title)
Yacare CaimanOP
i have already added it
@Yacare Caiman i have already added it
where did you added og:site_name? I couldn't found it inside your provided screenshots
Yacare CaimanOP
openGraph Sitename is not same?
@B33fb0n3 where did you added og:site_name? I couldn't found it inside your provided screenshots
Yacare CaimanOP
is it separately have to be added?
@B33fb0n3 Did you also added website data to your head? https://developers.google.com/search/docs/appearance/site-names#website
Yacare CaimanOP
yes i have tried to test it with other wesbite but it didnt work'
@Yacare Caiman Click to see attachment
can you confirm that you get a script at the end instead of a
<meta name='custom' value='your data' />
Yacare CaimanOP
yes it have it
also my website have indexd more that 5 months i thought google will take time to learn about my website but its not working i guess i dont know what i am doing wrong!
@Yacare Caiman yes it have it
which one, the script tag or the custom meta tag?
@Yacare Caiman also my website have indexd more that 5 months i thought google will take time to learn about my website but its not working i guess i dont know what i am doing wrong!
yes, google does that automatically, but sometimes it does not happen...
@B33fb0n3 can you confirm that you get a ``script`` at the end instead of a <meta name='custom' value='your data' />
Yacare CaimanOP
i am sorry! i didn't get the "script at end" thing please elaborate little
@Yacare Caiman i am sorry! i didn't get the "script at end" thing please elaborate little
you need to add a script tag to provide google a name that he can pick. I can look like this for example:
<script type="application/ld+json">
    {
      "@context" : "https://schema.org",
      "@type" : "WebSite",
      "name" : "Example",
      "url" : "https://example.com/"
    }
  </script>
that's the minimum. ^
At least name and url should be provided
After you done that, you can validate your schema: https://validator.schema.org/
@Yacare Caiman Click to see attachment
Yacare CaimanOP
if its given in the metadata function in others property will it work ? like that ?
@B33fb0n3 After you done that, you can validate your schema: https://validator.schema.org/
Yacare CaimanOP
i will do that for sure
@Yacare Caiman Okay then i will use it
lmk if it works
Yacare CaimanOP
currently the test is showing this
@Yacare Caiman currently the test is showing this
For that page you can check how google see's your page via this URL check tool: https://search.google.com/search-console?action=inspect

If everything looks good there, you can let google recrawl your site: https://developers.google.com/search/docs/crawling-indexing/ask-google-to-recrawl
@Yacare Caiman i hope u can reach the layout file from this https://github.com/piercing-wind/ai_flavoured/blob/Production/src/app/layout.tsx
The head tag inside nextjs app router is not recommended: https://github.com/piercing-wind/ai_flavoured/blob/Production/src/app/layout.tsx#L80
Make sure your remove it.

And as said: Use the script tag from nextjs that I mentioned to directly place the script inside your head: https://nextjs.org/docs/app/api-reference/components/script
You can inline your content like this:
<Script id="my-script">{`console.log('Hello world!');`}</Script>
Yacare CaimanOP
i have updated the file and btw is this bug? bulid time is counting backwards!
Yacare CaimanOP
what do i do next?
@Yacare Caiman what do i do next?
wait until the deployment finished
Yacare CaimanOP
it finished already
ah, then check if the schema is now there via https://validator.schema.org/
Yacare CaimanOP
@Yacare Caiman Click to see attachment
great. Now take a look at google search console. Is everything indexed. Does it look right? Does it have the correct html (esp. the head)? ...

If not -> recrawl
Yacare CaimanOP
everything is indexed
i think rest is on google!
@Yacare Caiman i think rest is on google!
make sure do recrawl to make the whole process faster
Yacare CaimanOP
done!
great, lmk if everything worked after the recrawl is done 👍
Yacare CaimanOP
okay i will update u
i submmited the req it takes time 1 or 2 days i gues
Yacare CaimanOP
hey i have another question about hosting!
if u are fimilar with aws amplify
Yacare CaimanOP
lets take a scenario : in nextjs when we interact with database we need to make connection with or (some api end point need to made req on server side) etc so it always runs on server! with that nextjs also support server action if client directly calls the server action in aws amplify it doesnt work! ( i know because aws doesnt support nodejs run time) but how the app/api/example/route.ts is executable on aws amplify satisfying the server side connection ? [ in short server action doesnt work but app/api works ]
@Yacare Caiman hey i have another question about hosting!
lets keep this thread to one issue 🙂
Feel free to open another thread
Yacare CaimanOP
okay!
Yacare CaimanOP
Nope
It's still showing domain url as name
@Yacare Caiman It's still showing domain url as name
is the recrawl done?
Yacare CaimanOP
Yeah
Last crawl is on २ - ३ jan
@Yacare Caiman Yeah
perfect. Take a look at the page content, that google crawled now
Yacare CaimanOP
How
@Yacare Caiman How
Click this button for the correct page:
And then click an "view crawed page"
Copy it and paste it into the validator: https://validator.schema.org/
Yacare CaimanOP
Can I invite you in serach console?
Under my domain? If you share gmail
@Yacare Caiman Can I invite you in serach console?
technically you can, but I don't want to
Yacare CaimanOP
Okay
Copy it and paste it into the validator: https://validator.schema.org/
Yacare CaimanOP
@Yacare Caiman Click to see attachment
That looks good. You are now suggesting google to take the specified name. Now google will decide if they use it or not
Yacare CaimanOP
yeah lets see if it uses or not
right now it's not changed yet. Maybe in the future. You done now everything you can do.

To conclude all steps that we've made:
You need to add this kind of script:
<script type="application/ld+json">
    {
      "@context" : "https://schema.org",
      "@type" : "WebSite",
      "name" : "Example Company",
      "alternateName" : "EC",
      "url" : "https://example.com/"
    }
  </script>

After you done that do the following:
1. Check if everything is online: https://validator.schema.org/
2. Check if your page is indexed: https://support.google.com/webmasters/answer/9012289
3. Let google recrawl your page: https://developers.google.com/search/docs/crawling-indexing/ask-google-to-recrawl
4. Check if google got your new script tag: https://nextjs-forum.com/post/1324434195933823089#message-1325383963056934933 and https://nextjs-forum.com/post/1324434195933823089#message-1325384253692973107
5. Validate that HTML with https://validator.schema.org/

Google made a whole guide for that: https://developers.google.com/search/docs/appearance/site-names
Answer
Yacare CaimanOP
Thank you! 🙏 I will update you if this work out!
happy to help