Programmatic SEO
Programmatic SEO
Templates, pages.json, link graph, and PSEO routes.
Overview
Programmatic SEO lets you generate many pages from templates and data. Use cases:
- Location pages (e.g. "Plumber in [City]")
- Comparison pages
- How-to guides
- Tool pages
- Hub pages
Templates
lib/pseo/templates.ts — Template configs:
| Template | Label | Min Words | Min FAQs |
|---|---|---|---|
hub | Hub | 400 | 3 |
tool | Tool | 500 | 4 |
comparison | Comparison | 600 | 4 |
howto | How-to | 700 | 5 |
location | Location | 500 | 3 |
pages.json
Page data lives in content/pseo/pages.json:
{
"pages": [
{
"id": "unique-id",
"slug": "page-slug",
"template": "hub",
"intent": "informational",
"primaryKeyword": "main keyword",
"supportingKeywords": ["kw1", "kw2"],
"title": "Page Title",
"description": "Meta description",
"headings": ["H2", "H3"],
"sections": [{ "title": "Section", "body": "Content..." }],
"faqs": [{ "question": "Q?", "answer": "A" }],
"hubId": null,
"relatedIds": [],
"schemaTypes": ["Article", "FAQPage"],
"lastModified": "2024-01-15"
}
]
}
Route
app/(pseo)/[template]/[slug]/page.tsx:
- Renders pages from
pages.jsonbytemplate+slug - Uses
getPseoPageBySlug(template, slug)fromlib/pseo/data.ts - Layout uses
LandingHeaderandLandingFooter
Link Graph
lib/pseo/link-graph.ts:
getHubPage(page)— Parent hub for a pagegetSiblingPages(page)— Siblings under same hubgetRelatedPages(page)— Related byrelatedIdsbuildBreadcrumbs(page)— Breadcrumb list for schema
Use these for internal linking and breadcrumbs on PSEO pages.
Validation
lib/pseo/validation.ts — Validates pages.json against template config (word count, FAQ count, etc.). Run pnpm validate:pseo in the product repo to check.
This marketing site has a separate check: pnpm validate:pseo in nextbento-landing. It fails if a comparison, integration, glossary, or persona page is missing Quick Answer / Decision Criteria / Evidence / Best For, has fewer than 3 FAQs, or has dateModified older than 180 days.
Sitemap
PSEO pages are included in sitemap segments /sitemaps/pseo-{template}. Add new pages to pages.json and they appear in the sitemap.
Live examples on nextbento.dev
This marketing site ships working pSEO pages you can study or link to:
- Comparisons — e.g. NextBento vs ShipFast
- Integrations — Supabase, Stripe, Resend
- Glossary — programmatic SEO, SaaS boilerplate, llms.txt
- Audiences — indie hackers and AI-assisted founders
Each detail page includes a Related pages block linking to pricing, docs, and sibling pages — see lib/pseo/link-graph.ts on the landing repo.
Related
- SEO tags are not a comparison-page factory — why metadata is not ranking for X vs Y
- Prompting SEO pages from a blank repo — the blank-repo vs-page loop
- How this site's programmatic SEO JSON factory works
- Keyword ownership map