Dynamic Sitemap Generation in Next.js: How OpenMyPro Indexes 1,000+ Pages
How OpenMyPro generates dynamic XML sitemaps in Next.js for 1,000+ provider pages, blog posts, and content pages. Implementation patterns, priority configuration, and indexing strategy.
See this stack in production. 150K+ users. six-figure ARR.
Free forever. Upgrade only when you're ready.
150K+ users · Ex-Amazon Engineer · Healthcare Innovation
No card charged today · 150K+ users · $0 to start
A sitemap is the roadmap you hand to Google. Without it, search engines are guessing which pages exist and which ones matter. OpenMyPro generates dynamic XML sitemaps for 1,000+ pages, and here is exactly how we implement sitemap generation in Next.js to ensure every provider page, blog post, and content page gets indexed.
Next.js Sitemap Route
Next.js supports sitemap generation through a special sitemap.ts file in the app directory. This file exports a default function that returns an array of sitemap entries, each with a URL, last modified date, change frequency, and priority. Next.js automatically serves this at /sitemap.xml with the correct Content-Type header.
For OpenMyPro, our sitemap includes static marketing pages, dynamically generated provider profile pages, blog posts, case studies, tech stack articles, and founder insights. Each category has its own URL generation logic but follows the same MetadataRoute.Sitemap return type.
Priority and Frequency Strategy
Not all pages are equal in search engine importance. We assign priority values based on business value: the homepage gets 1.0, provider search pages get 0.9, individual provider profiles get 0.8, blog posts get 0.7, and supporting pages like privacy and terms get 0.3.
Change frequency signals how often Google should recrawl. Provider profiles change weekly as availability updates, so they get "weekly." Blog posts rarely change after publication, so they get "monthly." The homepage content rotates with featured providers and gets "daily." These signals help Google allocate its crawl budget efficiently across our 1,000+ pages.
Dynamic Page Generation
The sitemap function dynamically pulls data from our content sources and database to generate URLs. For content pages, it includes blog posts, case studies, tech stack articles, and founder insights. For provider pages, it queries Supabase for all active provider slugs. This means every new provider page or blog post automatically appears in the sitemap on the next build.
The last modified date for each page comes from either the data record's publish date or the provider's profile update timestamp. Google uses this date to decide whether to recrawl a page, so accurate dates prevent unnecessary crawling of unchanged pages while ensuring updated pages get reindexed quickly.
Sitemap Index for Scale
When a site has more than 50,000 URLs, the XML sitemap specification requires splitting into multiple sitemaps referenced by a sitemap index. While OpenMyPro is not there yet, our architecture supports it. We can split the sitemap function into separate files — sitemap/providers.ts, sitemap/blog.ts — each generating a subset of URLs. Next.js handles the sitemap index automatically.
Google Search Console Integration
After deploying the sitemap, we submit it to Google Search Console for immediate processing. Search Console shows which pages are indexed, which have errors, and which are excluded. We monitor this weekly to catch indexing issues — a page showing as "Discovered but not indexed" signals a content quality problem that needs investigation.
Our indexing rate is over 95%, meaning nearly every page we generate gets indexed by Google within a week. The remaining 5% are typically pages with thin content or duplicate issues that we address in content updates.
Robots.txt Configuration
The sitemap URL is referenced in our robots.txt file, which also lives as a Next.js route handler. The robots file allows all crawlers, disallows internal tool routes, and points to the sitemap for page discovery. This standard SEO configuration ensures search engines find and respect our sitemap.
Performance Impact
Generating the sitemap is a build-time operation with zero runtime cost. Since our content pages are statically generated, the sitemap is also static — a pre-built XML file served from CDN. Google crawlers requesting /sitemap.xml get an instant response without invoking any server function.