DEV Community

Cover image for Adding a dynamic sitemap.xml to a next.js site

Adding a dynamic sitemap.xml to a next.js site

Fredrik Bergqvist on November 22, 2019

While building my blog with Next.js I naturally wanted to support sitemaps because it can supposedly help out the search engines. For my small blog...
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
fredrikbergqvist profile image
Fredrik Bergqvist

Isn't that what I did? :)

Collapse
 
devhammed profile image
Hammed Oyedele

Oh...I actually skipped that part 🤭🤭🤭

Collapse
 
tracker1 profile image
Michael J. Ryan

Just a minor note... You probably want to stick to the most recent 100 entries by last modified date and let any search engine navigate/remember the rest. Inflating the sitemap too big can work against you.

Collapse
 
fredrikbergqvist profile image
Fredrik Bergqvist

Yes, I did touch on it but maybe I should make it more clear.

Collapse
 
lewatt23 profile image
Mfou'ou Medjo stanly

Thanks great article !!

Collapse
 
fredrikbergqvist profile image
Fredrik Bergqvist

Thank you! Glad it could be of some help :)