Programmatic SEO for AI Coders | SheCodes
Advanced 9 min read

Programmatic SEO for AI Coders

One template + a database = hundreds of landing pages and free traffic on autopilot.

In this chapter

  • What programmatic SEO is and why it's the AI coder's superpower
  • How to find a keyword pattern worth automating
  • How to build the template + data combo in Next.js
  • How to avoid the spam trap and stay in Google's good graces

What Is Programmatic SEO?

Most websites have a fixed number of pages: homepage, about, pricing, blog. Programmatic SEO is different. You build one template and generate a unique page for every row in a database.

Real examples

  • Zillow: "[city] homes for sale": one page per city, 30,000+ pages
  • TripAdvisor: "Best [type] in [city]": millions of pages
  • G2: "[Tool A] vs [Tool B]": every comparison exists
  • Glassdoor: "[Job title] salary in [city]": endless permutations

Each page targets one specific long-tail keyword. None of them get tons of traffic individually. Together, they get millions.

Step 1: Find a Keyword Pattern

The whole strategy hinges on finding a search pattern with two parts: a template phrase and a variable.

Best [tool] for [use case] Best CRM for freelancers · Best CRM for startups · Best CRM for agencies
[city] [activity] guide Lyon coffee guide · Paris wine guide · NYC bookstore guide
[A] vs [B] Notion vs Coda · Airtable vs Notion · Linear vs Jira
How to [task] in [tool] How to add a column in Notion · How to invite users to Linear

Step 2: Get the Data

Each page needs real, unique content, not just "[city]" swapped in. The data lives in your database, a CSV, or an API.

Public datasets Wikipedia, OpenStreetMap, government data, Kaggle. Free and rich. Great for cities, countries, products, jobs.
Manual research You research 20-50 entries by hand to seed quality. Slower but the best for niche topics.
AI-generated + verified Use AI to generate first drafts, then manually verify every page. Faster than manual but still high quality.
User-contributed Users add entries themselves (like Yelp). The flywheel kicks in once you have 100+ pages.
Third-party APIs Stripe, Crunchbase, Hunter, Apollo. Pay for data, save time. Best for B2B niches.

Step 3: Build the Template

In Next.js, this is a single dynamic route file. Every URL matches the pattern, every page renders from your data.

The structure

app/
  [city]/
    coffee-guide/
      page.tsx        → /lyon/coffee-guide
                        /paris/coffee-guide
                        /nyc/coffee-guide

One file. Hundreds of URLs. Each one fetches its city's data and renders the same template with that data.

BUILD A pSEO TEMPLATE

“Build a programmatic SEO route in my Next.js app. Pattern: /[city]/coffee-guide. The page should: (1) accept a city slug as a param, (2) fetch coffee shop data for that city from my Supabase coffee_shops table, (3) render a long-form guide with a hero, intro paragraph, list of 10-15 shops with descriptions, FAQ, and a CTA. Use generateStaticParams to pre-render every city. Add unique meta tags, OG image, and JSON-LD structured data per city.”

Step 4: Tell Google About Every Page

You generated 500 pages. Google doesn't know they exist. The fix: a dynamic sitemap that lists every URL.

In Next.js:

  1. Create app/sitemap.ts that exports a function returning every URL
  2. Inside, query your database for every row and map to URLs
  3. Submit /sitemap.xml to Google Search Console
  4. Google starts crawling automatically
DYNAMIC SITEMAP

“Update my sitemap so it automatically includes every one of my auto-generated pages. Look at my coffee shops data, get the list of cities, and add a /[city]/coffee-guide entry for each one. Use the date each city was last updated so Google knows when the page changed, and mark these pages as updated weekly.”

The Quality Bar

Bad pSEO is spam. Good pSEO ranks for years. The difference is whether each page is genuinely useful. Five quality checks:

Unique data per page Every page has at least 60% unique content. The template is the same; the meat is different.
200+ words minimum Below 150 words and Google considers it "thin content." Aim for 400-800.
Real-world value Could a real person actually use this page? If you wouldn't share it on Twitter, don't publish it.
Internal links Link from each page to related pages (other cities, related topics). Builds the network.
No duplicate titles Each page's <title> tag must be unique. "Coffee in [city]" is fine if [city] is always different.

Common Gotchas

Pages are all almost identical

Add more unique data per page. Pull richer info from your sources, or write 2-3 unique sentences per page.

Build takes forever (5 min+)

You're using generateStaticParams for 10,000+ pages. Switch to dynamic rendering with ISR (revalidate every hour).

Google indexes 50 pages then stops

Crawl budget exhausted. Improve internal linking and submit the sitemap directly in Search Console.

Pages get indexed but rank for nothing

Your keyword pattern has no search volume. Use Ubersuggest or Ahrefs to verify before scaling up.

Real World Example: Building 200 city guides for your travel app

You have a travel SaaS and want to capture searches like 'best things to do in Lyon' or 'Paris weekend itinerary'. Manually writing 200 city guides would take months. With programmatic SEO, you scrape OpenStreetMap and Wikipedia for each city, store the data in Supabase, and build one Next.js template that renders all 200 pages, each with unique content, photos, and meta tags.

Build this with AI

“I want to build programmatic SEO city guides for my travel app. Pattern: /city/[slug] (e.g., /city/lyon, /city/paris). For each city, pull data from my cities table in Supabase (name, country, population, top 10 attractions, best season to visit, average daily budget). Build the page template with: hero image, intro, attractions list with descriptions, when-to-visit section, budget breakdown, FAQ, and a CTA to my main app. Add dynamic OG images, unique meta tags per city, and include all 200 cities in my sitemap.xml.”

Prompt This

COMPARISON PAGES

“Build comparison pages for my app at /vs/[tool-a]/[tool-b]. For each pair, fetch both tools' data (name, pricing, features) from my Supabase tools table and render a side-by-side comparison table, pros and cons, verdict, and a CTA. Generate every possible pair from my 20 tools. That's 380 pages.”

JSON-LD STRUCTURED DATA

“Add structured data (JSON-LD) to my programmatic pages. For each city guide, include schema.org Place and BreadcrumbList. This helps Google understand each page and show the page path in search results.”

ANALYTICS PER PAGE

“Add page-level analytics tracking so I can see which programmatic pages are getting traffic. Use Vercel Analytics or PostHog. Tag each page with the city/topic so I can filter and find the winners worth doubling down on.”

Frequently Asked Questions

What is programmatic SEO (pSEO)?

It's generating hundreds or thousands of landing pages from a database, each one targeting a specific long-tail keyword. Think Zillow's '[city] homes for sale' pages or Yelp's '[restaurant type] in [city]' pages. One template, lots of data, lots of search traffic.

Is this just spam?

It can be. The line between great pSEO and spam is whether each page actually helps the visitor. If someone searches 'best yoga studios in Lyon' and your page lists actual yoga studios in Lyon with real info, that's helpful. If it's the same AI-generated paragraph with the city name swapped in, that's spam.

How many pages should I generate?

Start small. 50-100 pages with great quality beats 5,000 pages with thin content. Google rewards depth, not volume. Once your first batch ranks, you can scale up.

Will Google penalize me for this?

Only if the pages are low-quality, duplicate, or auto-generated nonsense. Pages that genuinely answer a search query (even if generated from a template) are fine. Many of the biggest sites on the web (TripAdvisor, Yelp, Glassdoor) are 90% programmatic.