Practical guideUpdated 2026-09-15

Programmatic SEO on Next.js and Vercel

Programmatic SEO on Next.js means generating pages from data with dynamic routes and static generation or server rendering so that every page ships complete HTML, plus generated metadata and a sitemap route. On Vercel, rewrites in vercel.json or next.config can also serve pages from another origin under your domain, which is how SerionFlow publishes research-driven pages beside a Next.js app without changing the app.

Next.js on Vercel is a common stack for teams building programmatic SEO themselves, and it is also the stack SerionFlow supports natively through Vercel rewrites. This guide covers the rendering decision that determines whether generated pages are crawlable, the routing and metadata pattern, sitemap generation, the rewrite mechanism for serving pages beside the app, and the checks that catch the client-only rendering mistake before it costs months.

01

Rendering: the decision that matters most

Next.js can render a page at build time (static generation), on request (server rendering), or in the browser (client-side). For programmatic SEO only the first two are acceptable, because Google's first indexing pass and every AI crawler read the HTML the server returns without executing JavaScript. A client-rendered page returns a shell with a loading state; SerionFlow's own marketing site made this mistake and served 111 to 229 words of static HTML per page, which explained its "Crawled, currently not indexed" status and zero AI citations until the prerender was fixed.

Use static generation for pages whose data changes rarely and server rendering, with caching, for pages that must reflect fresh data. Incremental static regeneration blends the two.

02

The native pattern: dynamic routes, data, metadata, sitemap

Define a dynamic route such as app/guides/[slug]/page.tsx, load the page's content from a data source in the route, and render the full article with headings, tables, FAQ, and related links in the component. Export generateStaticParams to enumerate slugs at build time and generateMetadata to produce a unique title, description, and canonical per page. Add an app/sitemap.ts route that lists every generated URL with lastmod, and a robots route or static file. Structured data goes in a script tag rendered by the component so it is in the HTML.

Next.js programmatic SEO building blocks
ConcernMechanismCheck
Page generationDynamic route with generateStaticParamsEvery slug builds; no client-only fetch for content
MetadatagenerateMetadata per routeUnique title and description; canonical set
Structured dataJSON-LD script rendered in the componentPresent in raw HTML; matches visible content
Sitemapapp/sitemap.tsLists all generated URLs with accurate lastmod
Internal linksRelated-links component from the data sourceEvery page linked from a hub and siblings
CachingStatic generation or ISRTime-to-first-byte stays low at scale
03

Serving pages beside the app with Vercel rewrites

Vercel rewrites, configured in vercel.json or next.config, map a path on your domain to another destination, including an external origin. A rewrite for /explore/:path* to SerionFlow's origin serves SerionFlow-generated pages under your domain while the rest of the app is unchanged. The pages are first-party URLs, they share the Search Console property, SerionFlow maintains their sitemap, and nothing in the Next.js codebase changes beyond the rewrite. This is one of the two routing paths SerionFlow documents, alongside Cloudflare Workers.

Teams use this when they want the app to stay focused on product and a separate loop to research, draft, review, and refresh SEO pages from Search Console data.

04

Scale considerations

Build time grows with page count under static generation; use ISR or on-demand revalidation past a few thousand pages. Keep the data source, whether a database, a CMS, or JSON files, as the single source for content, metadata, and sitemap so they cannot drift. Generate related links from the data so no page is orphaned. Run a post-build check that fetches a sample of generated HTML and asserts word count, headings, canonical, and JSON-LD; it is cheap and catches regressions.

  • ISR or on-demand revalidation for large sets.
  • One data source for content, metadata, and sitemap.
  • Post-build HTML assertions on a sample.
05

Crawlability checks before launch

Fetch a generated page with curl and confirm the article is there. Fetch it with Googlebot and AI crawler user agents and confirm 200 with full HTML; Vercel's firewall and any bot protection should allow them. Confirm robots.txt allows the generated paths and the sitemap is submitted. Validate JSON-LD on a sample. SerionFlow's free AI crawler access checker and robots.txt checker cover the fetch tests without an account.

06

Build it or route it

Build natively when you own the data, have engineering time, and want complete control over templates and rendering. Route to a platform when the pages must be discovered from Search Console and competitor evidence, drafted per intent, reviewed, and refreshed weekly, and when engineering time is better spent on the product. Many teams do both: native routes for data-driven pages and a rewrite to SerionFlow for research-driven ones.

Step by step

  1. 01

    Choose rendering

    Use static generation or server rendering for every programmatic route; never rely on client-side fetching for indexable content.

  2. 02

    Create the dynamic route

    Add a [slug] route that loads content from your data source and renders the full article with headings, tables, FAQ, related links, and JSON-LD.

  3. 03

    Generate metadata and sitemap

    Implement generateMetadata for unique titles, descriptions, and canonicals, and app/sitemap.ts listing every generated URL.

  4. 04

    Add a rewrite if routing beside the app

    In vercel.json or next.config, rewrite a path such as /explore/:path* to the external origin following its documentation.

  5. 05

    Verify raw HTML

    Fetch sample pages with curl and with crawler user agents; assert word count, headings, canonical, and JSON-LD are present.

  6. 06

    Submit and monitor

    Submit the sitemap in Search Console and Bing Webmaster Tools and check the Pages report after a week.

Clear answers

Frequently asked questions

Should programmatic Next.js pages use static generation or server rendering?

+

Either, as long as the full HTML is returned by the server. Static generation suits rarely changing content; server rendering with caching or ISR suits fresh data. Client-side rendering is the one option to avoid, because crawlers and AI engines read the initial HTML only.

How do Vercel rewrites let another platform serve pages on my domain?

+

A rewrite maps a path on your domain to another destination without a redirect, so the browser and crawlers see your URL while the content comes from the destination origin. SerionFlow documents a rewrite for its generated-page path; the Next.js app is otherwise unchanged.

How do I generate a sitemap for programmatic pages in Next.js?

+

Add an app/sitemap.ts route that reads the same data source as your pages and returns every URL with an accurate lastmod. Keep content, metadata, and the sitemap on one source so they cannot drift. Submit the sitemap URL in Search Console.

How do I check my Next.js pages are crawlable by AI engines?

+

Fetch a page with curl and with GPTBot, ClaudeBot, and PerplexityBot user agents, expecting 200 and the full article in the response. Check robots.txt and any bot protection on Vercel. A free AI crawler access checker automates the fetch tests.

Does SerionFlow require a Next.js app?

+

No. SerionFlow serves pages under your domain through either Vercel rewrites for any Vercel-deployed site or a Cloudflare Worker for domains on Cloudflare DNS. A Next.js app on Vercel is simply one of the most direct fits for the rewrite path.

Continue exploring

Related SerionFlow resources

More in Guides

All guides

Make the next move obvious

Let SerionFlow turn your market evidence into momentum.

Confirm the market, rank the opportunities that matter, create brand matched pages on your domain, and keep moving with controlled weekly intelligence.

Choose how SerionFlow uses cookies.

Essential cookies keep the site secure and working. Product analytics helps us improve reliability. Optional cookies help us remember preferences and improve campaigns. You can change optional cookies anytime in Cookie Settings.