Shipping Programmatic Pages Behind a Quality Gate: The Pre-Index CI We Wish We'd Built Sooner
Programmatic SEO fails when you ship thin pages and let Google decide. Here's the pre-index CI pipeline we use to block low-quality templates before they ever hit the sitemap.
The first time we shipped a programmatic SEO template at scale, we pushed 18,000 pages in a single deploy. Six weeks later, Search Console had indexed about 2,400 of them and politely ignored the rest — and the ones it did index were dragging down the whole subdirectory. The fix wasn't better templates. It was a CI gate that refused to let bad pages reach the sitemap in the first place.
Why "ship it and iterate" breaks programmatic SEO
For product code, shipping fast and iterating is usually correct. For programmatic pages, it's a trap. Google evaluates quality at the directory and site level, not just the URL level. Ship 20,000 near-empty /cities/[slug] pages and the crawler will downgrade your trust for the whole pattern, including the 2,000 pages that were actually good.
The asymmetry is brutal:
- A bad page costs you crawl budget, index slots, and site-level quality signals.
- A page that never ships costs you nothing except a row in a backlog table.
So the default should flip. Instead of "generate everything, deindex the losers," we treat every programmatic URL as a build artifact that has to pass tests before it earns a spot in sitemap.xml.
The pipeline, end to end
Our quality gate runs as a scheduled job, not as part of the app deploy. Decoupling matters — content velocity shouldn't be blocked on a frontend release, and a failing content build shouldn't take down the site.
The stages, in order:
- Source hydration — pull the row set from the data warehouse for the template (e.g.
city x service). - Enrichment — fetch anything that gives the page real information density: review counts, pricing ranges, local entities, geo data, inventory.
- Render — run the template server-side into HTML, exactly as a crawler would see it.
- Scoring — run each page through a battery of checks.
- Verdict — tag each URL as
publish,noindex, orreject. - Sitemap diff — update
sitemap.xmland ping GSC only for the delta.
The scoring stage is where most teams either over-engineer or under-engineer. Here's what actually earns its keep.
The checks that matter
In our experience, five checks catch roughly 90% of the garbage. Everything else is diminishing returns.
def score_page(rendered_html, row, corpus):
checks = {
"word_count": count_visible_words(rendered_html) >= 350,
"unique_body_ratio": unique_shingle_ratio(rendered_html, corpus) >= 0.55,
"data_density": count_structured_facts(row) >= 6,
"has_entity_match": row.get("entity_id") is not None,
"no_null_placeholders": not contains_placeholder_strings(rendered_html),
}
return checks, all(checks.values())
A few notes on each:
- Visible word count uses the rendered DOM minus nav, footer, and boilerplate. Counting raw HTML is useless.
- Unique shingle ratio compares 5-grams in the body against a rolling corpus of already-published pages in the same template. Anything under ~0.5 is effectively a duplicate with the city name swapped.
- Data density counts how many non-null, non-boilerplate facts the row contributes. A page about "plumbers in Leeds" with zero actual plumbers is a reject, not a
noindex. - Entity match means the primary subject resolves to something in your knowledge graph (Wikidata, your own entity store, whatever). If it doesn't, you're guessing.
- Placeholder detection is the embarrassing one.
"We have 0 results for {city}"ships more often than anyone admits.
Verdicts: publish, noindex, reject
Binary gates are too coarse. We use three states, and the distinction matters for how Google treats the URL space over time.
- publish — passes all checks, goes into
sitemap.xml, gets internal links. - noindex — fails soft checks (e.g. low unique content ratio but real data). Page still renders for direct visitors, but ships with
<meta name="robots" content="noindex,follow">and is excluded from the sitemap and internal link graph. - reject — fails hard checks (no data, placeholders, no entity). The route returns 404. The URL never existed as far as the site is concerned.
The mistake we made early on was treating noindex as a permanent destination. It's a waiting room. Every page in noindex should have a clear path to publish — usually more data enrichment. If a page has been stuck in noindex for 90 days with no path forward, it should graduate to reject.
A small state machine
[new] --score--> publish
\-> noindex --re-enrich--> publish
\--90d stale---> reject
\-> reject
Store the state and the reason in your content database, not just in the rendered HTML. You'll want to query "all pages rejected because of low data density" when a new data source lands.
Wiring it to GSC and GA4
The gate decides what can rank. GSC and GA4 tell you whether your decisions were right. We pull two signals back into the pipeline weekly:
- Impressions-per-indexed-page from the GSC API, grouped by template. If a template's median drops below ~3 impressions per page per week after 60 days live, the thresholds for that template get tightened.
- Engaged sessions per landing page from GA4. Pages with persistent zero engagement for 30+ days after indexing move to
noindexautomatically.
This closes the loop. The gate stops getting more permissive over time just because the backlog is loud.
What this looks like in CI
We run the scoring job nightly on a scheduled worker, not inside the main app's CI. But the template changes go through normal PR review, and this is where engineers tend to under-invest.
For any PR that touches a programmatic template, we run a sample pass: 200 random rows through the full render + score pipeline, with results posted back to the PR as a comment.
# .github/workflows/pseo-template-check.yml
name: pSEO template check
on:
pull_request:
paths:
- "templates/pseo/**"
- "lib/pseo/**"
jobs:
sample-score:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: "20" }
- run: npm ci
- run: npm run pseo:sample -- --template=${{ github.event.pull_request.title }} --n=200
- run: npm run pseo:report -- --fail-under=0.75
The --fail-under=0.75 means the PR fails if fewer than 75% of sampled pages would earn publish. That number is arbitrary — pick your own — but having any number forces the conversation.
The things we got wrong
A few lessons from running this for a couple of years across different client stacks:
- Don't score on raw HTML. Headless-render the page. What the scorer sees should match what Googlebot sees, including client-side hydration if you use it.
- Don't trust word count alone. We had a template hit 600 words of pure boilerplate variations. Shingle uniqueness is the check that actually bites.
- Version your thresholds. When you tighten
unique_body_ratiofrom 0.5 to 0.6, tag the change. You'll want to correlate ranking shifts to threshold changes six months later. - Keep a graveyard. Rejected URLs should stay in a table forever, with their reason. You'll rediscover the same bad ideas every quarter otherwise.
- Don't ping GSC on every change. Submit the sitemap on meaningful deltas (>1% of URLs changed state), not nightly. The crawler notices either way.
Where we'd start
If you're staring at a programmatic template that's underperforming, don't rewrite the template first. Instrument it. Run the five checks above against your current URL set and bucket the results. In our experience, somewhere between 30% and 60% of a typical programmatic estate would fail a modest quality gate — and pulling those pages out of the index usually moves the survivors up within two crawl cycles.
Build the gate as a batch job, not a framework. Start with a CSV of URLs and verdicts. Wire it into the sitemap second. Wire it into CI third. The whole thing is a weekend of work for a backend engineer, and it's the highest-leverage SEO engineering we've shipped in the last two years.
If you want a second pair of eyes on a programmatic estate, our SEO and content engineering team does exactly this kind of audit.
Want a team like ours?
72Technologies builds production software for the kind of teams who actually read this blog.
Start a projectKeep reading
Log-File Analysis for Programmatic SEO: Finding the Pages Googlebot Actually Cares About
GSC tells you what Google indexed. Log files tell you what Googlebot actually hits. Here's how we use raw server logs to find crawl waste, prioritize refreshes, and stop shipping programmatic pages into the void.
Internal Linking at Scale: The Graph-Based Approach That Fixed Our Orphan Page Problem
Manual internal linking dies at 500 pages. Here's how we modeled our site as a graph, found orphans and dead-end clusters, and automated link injection without turning the footer into a link farm.
Programmatic SEO Data Models: The Schema That Decides Whether Your Pages Rank or Rot
Most programmatic SEO failures aren't content failures — they're data model failures. Here's how we design the schema behind 10k+ page sets so pages have something real to say, and Google has a reason to keep them.
