Next.js
/Intermediate
Sitemaps
Definition
An XML file (`sitemap.xml`) that acts as a roadmap of your website for search engines, listing all public URLs so Google doesn't have to guess where your pages are.
Explain Like I'm New
If your site has 5,000 blog posts, Google's bot might miss some if it just clicks around randomly. A sitemap is a list you hand directly to Google saying: 'Here are the exact 5,000 URLs I want you to rank in search results.'
Real World Example
Creating a dynamic `sitemap.ts` file in Next.js that queries your database, gets all 5,000 blog post slugs, and automatically generates the XML file for Google.
Common Use Cases
- •Technical SEO
- •Large e-commerce catalogs
- •Content-heavy blogs
Interactive Example
Loading Code Playground...
Interview Questions
basic
- If you just have a 3-page portfolio site, do you strictly need a complex dynamic sitemap?
intermediate
- How does Next.js automatically generate a sitemap using code?