Improving SEO with (Dynamic) Sitemaps in Next.js

  Рет қаралды 38,473

Leigh Halliday

Leigh Halliday

Күн бұрын

Пікірлер
@leighhalliday
@leighhalliday 3 жыл бұрын
Check out my course called Next Level Next.js! A full stack course covering GraphQL, TypeScript, Apollo, Prisma, auth and lots more! next.leighhalliday.com
@FarhanAhmed1360
@FarhanAhmed1360 2 жыл бұрын
working on localhost but getting internal server error 500 on production server
@RdozeTV
@RdozeTV 2 жыл бұрын
This is the most clear tutorial straight to the point
@aleemehsan761
@aleemehsan761 3 жыл бұрын
May Allah Bless You with peace. You have solved a lot of my burden. Love from Pakistan
@leighhalliday
@leighhalliday 3 жыл бұрын
Love from Canada!
@daveisdead
@daveisdead 3 жыл бұрын
I just wanna say how much your videos have helped me with nextjs. It’s a newer technology so there’s not a whole lot of help out there but I can always count on you for a lot of the answers. Thank you 🙏
@leighhalliday
@leighhalliday 3 жыл бұрын
Thanks Dave!! Really happy that they are helpful!
@bigLoser818
@bigLoser818 2 жыл бұрын
Thanks for breaking this down into smaller, bite-size bits. Very helpful. New subscriber.
@imsarvesh_
@imsarvesh_ 3 жыл бұрын
This channel is absolutely fantastic
@ali_kazmi_
@ali_kazmi_ 2 жыл бұрын
Leigh Thank you so much. I needed to implement it the same way you did. It was a great help. These videos help a lot, maybe I should start making some as well.
@mohamedboufraine9368
@mohamedboufraine9368 2 жыл бұрын
Thank you very much for this content, it´s always useful to watch your videos on nextjs :)
@FarhanAhmed1360
@FarhanAhmed1360 2 жыл бұрын
Great video man
@tire
@tire 2 жыл бұрын
this is what I exactly want. Thank you sir!
@israel5450
@israel5450 Жыл бұрын
This is very useful, but how do you approach this if all the application routes are within a dynamic parent directory; like [locale]?
@anthony_riera
@anthony_riera 2 жыл бұрын
Thanks a lot for that, it was really helpful!
@76Freeman
@76Freeman 3 жыл бұрын
As always, great video and extremely useful. Thank you Leigh
@leighhalliday
@leighhalliday 3 жыл бұрын
Thank you Helio!
@TheHimu30
@TheHimu30 2 жыл бұрын
Very well detailed tutorial I must say
@TechSignn
@TechSignn 2 жыл бұрын
How can i do the same thing but using npm instead of yarn ?
@exactzero
@exactzero 3 жыл бұрын
Thanks! I've been looking for ways to solve this.
@leighhalliday
@leighhalliday 3 жыл бұрын
Nice :D Me too, I just learned it last week for a personal project.
@chris_and_music
@chris_and_music 3 жыл бұрын
Thanks a lot! Worked perfectly for me
@leighhalliday
@leighhalliday 3 жыл бұрын
Excellent :)
@TheVGJournal
@TheVGJournal Жыл бұрын
Hey Leigh! Do you know if I need to switch to getServerSideProps if I am using getStaticProps in order to take advantage of next-sitemap? It seems I get all my dynamic pages, but I may be overlooking it. Love all your content, thanks!
@azizee
@azizee 8 ай бұрын
hi, how do i manage the priority and lastmod? currently it show all with same priority and lastmod.
@SubhajitDas-m1e
@SubhajitDas-m1e Жыл бұрын
i have multiple dynamic route how to do it
@Skillthrive
@Skillthrive 3 жыл бұрын
So easy! I just moved my site to Next.js, so I'm looking forward to getting this installed.
@angelmcorrea1704
@angelmcorrea1704 3 жыл бұрын
Thank you so much, very clear, to the point.
@miscany
@miscany 2 жыл бұрын
Great video man. I honestly don't really use typescript, but nice job.
@LuizFerK
@LuizFerK 3 жыл бұрын
This content is amazing! Thank you so much for all that extremely useful information.
@leighhalliday
@leighhalliday 3 жыл бұрын
Thank you! Glad you enjoyed it Luiz!
@tomek4132
@tomek4132 2 жыл бұрын
Thanks. It helped a lot.
@leighhalliday
@leighhalliday 2 жыл бұрын
Glad it helped!
@siumauricio2673
@siumauricio2673 2 жыл бұрын
Your Goat!!
@kadyratamuradov8687
@kadyratamuradov8687 2 жыл бұрын
Thank you))
@GenLensOfficia
@GenLensOfficia 3 жыл бұрын
Your video is helpful. But one problem when I deploy this in vercel then this server-side dynamic sitemap pages not working. It's showing me 500 internal Server Error. What is the problem here after deploy in vercel?
@uancamilo
@uancamilo 2 жыл бұрын
yes, I was going to comment the same! I'm facing the same issue as well.
@dylanpayne9954
@dylanpayne9954 2 жыл бұрын
Thank you!!!!!
@jaza7613
@jaza7613 3 жыл бұрын
Awesome!
@TshepoShere
@TshepoShere 3 жыл бұрын
So how do we handle multiple endpoints?
@leighhalliday
@leighhalliday 3 жыл бұрын
You’ll have to do multiple fetch calls to get all your data
@TshepoShere
@TshepoShere 3 жыл бұрын
@@leighhalliday Awesome, i get it
@hamed4451
@hamed4451 3 жыл бұрын
whats happend for marketplaces with tones of products ? is this way good for them? i have to get all the products from the api , it takes lots of time , isnt it ?
@anthon952
@anthon952 3 жыл бұрын
Hi thanks for the video... A question, My website has more than 200k of pages, and it takes long to generate the sitemap in the node server, any way to handle this?
@FarhanAhmed1360
@FarhanAhmed1360 2 жыл бұрын
working on localhost but getting internal server error 500 on production server
@niketchandivade3311
@niketchandivade3311 3 жыл бұрын
How can we create sitemap index file ?
@rafaelreale8848
@rafaelreale8848 3 жыл бұрын
and for pages that are generated after building it? Using fallback 'blocking' ?
@leighhalliday
@leighhalliday 3 жыл бұрын
If you want them in your site map file you’ll have to take the dynamic approach and add them yourself.
@rafaelreale8848
@rafaelreale8848 3 жыл бұрын
@@leighhalliday In this case, do you say fetch all pages previously in the api? I have 6 million pages. I don't think I can do this.
@leighhalliday
@leighhalliday 3 жыл бұрын
Hmm, That sounds like a lot to put into a site map haha. Does google support that many?
@youssefkanbour9308
@youssefkanbour9308 2 жыл бұрын
Did you figure out how the approach to fetch the 6 million pages? I'm struggling with something similar, but its around 500 pages, but it still would take a long time for the backend to give me all the content
@zidanegimiga
@zidanegimiga 2 жыл бұрын
@@rafaelreale8848 I hope you solved your issue. Did mine by setting the siteMapSize according to the number of dynamic url options. It's avalable at the package's documentation.
@funnynews341
@funnynews341 Жыл бұрын
i have done like that, but google search console said that's my site map get over 50.000 link. But i limit under 50.000, i don't know why?
@AbhishekSingh-ee2bo
@AbhishekSingh-ee2bo Жыл бұрын
I am in a situation where I am implementing the same way and I have an Nextjs Edge function powered by Vercel. The deployment is failing on Vercel and I do not have any solution for that till now Please do let me know if you find the solution.
@vivekknShots
@vivekknShots 3 жыл бұрын
Does this dynamic aproch work r if a new id comes in api after build is made in vercel for ex: like stack overflow a new question is added so a new id is made in production so will sitemap be generated for the new question ?
@leighhalliday
@leighhalliday 3 жыл бұрын
Yup! It should be calculated on the fly… unless you have caching turned on. You can try by visiting the page yourself in the browser and seeing what is in the XML file.
@LuizGustavo-wr7rm
@LuizGustavo-wr7rm 2 жыл бұрын
​@@leighhalliday Hello. First, thanks for the tutorial. That doesn't work for me, I tried to implement in a blog and the sitemap file only update the links on build, any idea of can be happening? Thanks again!
@formsolution
@formsolution Ай бұрын
@@LuizGustavo-wr7rm Hi you found any solution for this ? if new id is added it will add in sitemap after build?
@TheBoglodite
@TheBoglodite 2 жыл бұрын
Is this compatible with Next-SEO?
@youssefkanbour9308
@youssefkanbour9308 2 жыл бұрын
Hello Leigh, love the tutorial. Say that I want to have a sitemap for all the users in my database, but there are over 20,000 users and to fetch these 20,000 users, i have to receive them paginated, i.e: page 1 (first 500 users), page 2 (second 500 users), and so on, and i have to keep calling until there are no more pages left. when creating the users sitemap, do i first load all of the 20,000 users and then generate the sitemap, and next-sitemap takes care of it by splitting it into multiple files, or is there a way to load a given page X of users, and creating the sitemap specific for that page: i.e: users-sitemap/5 I'm just held back a bit by this approach, not sure what the google search engine prefers either. Thank you!
@leighhalliday
@leighhalliday 2 жыл бұрын
Hey Youssef! I think you have to load all 20k user records into memory (even though that'll be done with multiple calls), and then the package will do the work of splitting them into multiple sitemap files. That said, I think a single Sitemap file can contain 50k records. I'd say just give it a try! My only worry is that it'll slow down your build/deploy considerably, so honestly at this size I would consider other approaches... maybe doing SSR with a week long cache.
@omarhosny9354
@omarhosny9354 3 жыл бұрын
Great 👌 I need to deploy nextjs on custom server not on vercel i don't know what to do Any help would be appreciated
@GeniusHawlah
@GeniusHawlah 2 жыл бұрын
Hi, did you find solution?
@jamestucker4800
@jamestucker4800 Жыл бұрын
nginx reverse proxy it
@wanfahdiva4808
@wanfahdiva4808 2 жыл бұрын
hi sir, i have a problem when i run yarn next-sitemap, the result of the public sitemap file becomes two, i.e. sitemap-0.xml and sitemap.xml.. is this okay for the future?
@skverskk
@skverskk 2 жыл бұрын
To resolve this issue, add the following line to your next-sitemap-config.js file: generateIndexSitemap: false, Now when you run, npm run build, it will create just one xml file called sitemap.xml. The next-sitemap documentation is poor and this issue is never even brought up.
@mlnima
@mlnima 2 жыл бұрын
I have like 100k post and for example in 1 month added like 50k, if I do like this the sitemap file get so big, any solution?
@ankitsinha5127
@ankitsinha5127 2 жыл бұрын
How can we implement in React js
@leighhalliday
@leighhalliday 2 жыл бұрын
That's a complicated question Ankit... by React I am assuming you mean "create-react-app" or something outside of Next/Gatsby/Remix. And if that's the case, I am honestly not sure... you'll need some sort of custom build step or server-rendered page if you want it to be dynamic.
@ridl27
@ridl27 3 жыл бұрын
ty
@leighhalliday
@leighhalliday 3 жыл бұрын
My pleasure, Alex!
@giorgieliozashvili633
@giorgieliozashvili633 2 жыл бұрын
i'm getting 404
@Motivation-qj6id
@Motivation-qj6id 2 жыл бұрын
Typescript really turn me off lol .
@Maybehassanawad
@Maybehassanawad 3 жыл бұрын
you gotta make a patreon account 😂
@leighhalliday
@leighhalliday 3 жыл бұрын
Haha thanks Hassan. If you want to support you could either buy my course at next.leighhalliday.com or join the channel as a member :)
@Maybehassanawad
@Maybehassanawad 3 жыл бұрын
@@leighhalliday happy to be a member :)
@satyamskillz
@satyamskillz 3 жыл бұрын
Thanks, however I did it a few months ago, it was easy
@leighhalliday
@leighhalliday 3 жыл бұрын
Nice! I did this for the first time just last week :)
Mastering the basics of SEO in React and Next.js
12:05
Leigh Halliday
Рет қаралды 48 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
How to Create a PWA With Next.js in 10 Minutes
13:08
James Q Quick
Рет қаралды 114 М.
How I added a sitemap to Next.js website (next-sitemap)
11:03
caleyCodeLab
Рет қаралды 32 М.
Managing Assets and SEO - Learn Next.js
14:18
leerob
Рет қаралды 18 М.
React SEO with Next.js - Dynamic SEO Meta Tags Tutorial
12:06
Colby Fayock
Рет қаралды 41 М.
Client-Side VS Server-Side Rendering - Data Fetching with Next.js
13:20
freeCodeCamp Talks
Рет қаралды 184 М.
Next.js Crash Course
1:09:45
Traversy Media
Рет қаралды 821 М.
IP Address Allow/Deny with Cloudflare Workers and Upstash Redis
30:04
Leigh Halliday
Рет қаралды 3,2 М.
NextJS 12.1 SSR & SSG: Everything you need to know
31:18
Jack Herrington
Рет қаралды 99 М.
Improving page performance | Next.js
9:32
WebDevWithArtisan
Рет қаралды 32 М.