Skip to content

Add live SEO sanity check (sitemap status, self-canonical, noindex placement) - #272

Draft
manav4u wants to merge 1 commit into
mainfrom
seo/sitemap-canonical-check
Draft

manav4u wants to merge 1 commit into
mainfrom
seo/sitemap-canonical-check

Conversation

@manav4u

@manav4u manav4u commented Nov 2, 2026

Copy link
Copy Markdown
Owner

What

scripts/seo-check.mjs - a dependency-free Node script that runs live SEO sanity checks against the deployed site:

  • Fetches sitemap.xml and crawls every listed URL (170 today), asserting: HTTP 200, exactly one rel=canonical tag, canonical equals the sitemap URL, and no noindex on public pages.
  • Asserts the deliberate design: /app/, /app/settings/, /onboarding/ serve 200 with noindex.
  • Asserts unknown paths (/syllabus/__seo-check-missing__/) return a real HTTP 404 with the noindex shell - never a soft 404.
  • Takes an optional base URL (node scripts/seo-check.mjs <preview-url>) so the same check can gate a preview deploy before it ships.

Why

Grounded in the October homepage canonical-exclusion incident: Google dropped the homepage after selecting the github.io origin as canonical (Duplicate, Google chose different canonical than user). A canonical check on every sitemap URL catches that class of problem at ship time instead of weeks later in Search Console. The soft-404 assertion locks in the postbuild 404 behavior.

Verification

  • node scripts/seo-check.mjs against production: 170 sitemap URLs, PASS (run Nov 2, 2026).
  • Script-only change; no app code, no production impact.

Prep-only PR per standing workflow: review before merge.

…acement)

scripts/seo-check.mjs crawls every sitemap URL against the deployed site
and asserts: HTTP 200, exactly one canonical tag matching the sitemap URL,
no noindex on public pages; plus the deliberate noindex on app routes and
a real 404 (never a soft 404) for unknown paths. Accepts a base URL so the
same check can gate a preview deploy before it ships.

Grounded in the October canonical-exclusion incident, where Google picked
the github.io origin over the custom domain for the homepage.

Co-authored-by: MaxwithU19 <156198184+MaxwithU19@users.noreply.github.com>
@manav4u
manav4u force-pushed the seo/sitemap-canonical-check branch from 7824134 to 7cf2456 Compare November 2, 2026 12:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant