We have an app where the Admin adds events dynamically.
Let’s say our event has a URL : abc.com/100/Rishikesh-Retreat
or abc.com/100/Mumbai-Retreat
Now, my query is how Google will index these dynamic pages. Shall I update my sitemap.xml every 24 hours using cron job and then shall I ask Google to crawl the site manually? Can we automate the part where we ask Google to crawl our website once the sitemap is updated?
We are using React and have a simple Node Server that serves the site and updates the metadata tags.
We were planning to move to Next JS if it helps with SEO for dynamic pages.
Our aim is that the dynamic pages should get indexed and when we search for them the results should appear on the first page.
2
Answers
from next sitemap docs
if you add
sitemap.ts
in your app directory and runnpm run build
, it will create a static routeThis means when you visit your sitemap url
http://localhost:3000/sitemap.xml
sitemap special route handler will be called. you probably have seen creating dynamic sitemap code. For example from hereWith those being sad, everytime your sitemap url is called you have to make sure
sitemap()
cache gets invalidated and you make a freshsitemap()
call. I did not test this but if you try to add this on top of "app/sitemap.js"after this setting, if you rebuild your app,
/sitemap
will be dynamic:You should make create html file dynamically by the admin side where admin will write all the meta data and add the things which you provide and after submission its html file will be created and that will be good for indexing.
But if you create your website in Next.js and when admin create any event, you have to build your next.js project and that static files will be created by using generatestaticparams so whenever admin adds another event you have to build your project and then upload it your server